>[!definition] A class is an *abstraction* of data and state that is coupled with code. Classes are the core component of [[Object Oriented Programming]], and define the paradigm’s opinion on state. Classes are the main concept in [[C++]], and where most of it’s features revolved around - because [[C++]] was originally created (and almost named) to simply be “C with Classes.” A class in [[C++]], at a base level, is an extended C `struct` that allows us to [[Encapsulation|encapsulate data]], tie [[Method|functions directly to values of said class]], and control how to [[Constructor|initialise]] and [[Destructor|safely destruct]] data. Classes have these core components: - [[Constructor]] - [[“This”]] - [[Destructor]] - [[Method]] - [[Polymorphism]] / [[../../99 Old/CS-230/Inheritance]] >[!example] Example >[[CString|Fully baked]] class in [[C++]]