  class-based programming, or more commonly class-orientation, is a style of object-oriented programming (oop) in which inheritance is achieved by defining classes of objects, as opposed to the objects themselves (compare prototype-based programming). the most popular and developed model of oop is a class-based model, as opposed to an object-based model. in this model, objects are entities that combine state (i.e., data), behavior (i.e., procedures, or methods) and identity (unique existence among all other objects). the structure and behavior of an object are defined by a class, which is a definition, or blueprint, of all objects of a specific type. an object must be explicitly created based on a class and an object thus created is considered to be an instance of that class. an object is similar to a structure, with the addition of method pointers, member access control, and an implicit data member which locates instances of the class (i.e. actual objects of that class) in the class hierarchy (essential for runtime inheritance features). ==encapsulation== encapsulation prevents users from breaking the invariants of the class, which is useful because it allows the implementation of a class of objects to be changed for aspects not exposed in the interface without impact to user code. the definitions of encapsulation focus on the grouping and packaging of related information (cohesion) rather than security issues. oop languages do not normally offer formal security restrictions to the internal object state. using a method of access is a matter of convention for the interface design. ==inheritance==  in class-based programming, inheritance is done by defining new classes as extensions of existing classes: the existing class is the parent class and the new class is the child class. if a child class has only one parent class, this is known as single inheritance, while if a child class can have more than one parent class, this is known as multiple inheritance. this organizes classes into a hierarchy, either a tree (if single inheritance) or lattice (if multiple inheritance). the defining feature of inheritance is that both interface and implementation are inherited; if only interface is inherited, this is known as interface inheritance or subtyping. inheritanc
Object-oriented_programming