OBJECT ORIENTED PROGRAMMING
OBJECT ORIENTED PROGRAMMING:
The principles of OOPS are:
1) Abstraction
3) Inheritance
4) Polymorphism
1) Abstraction:
Abstraction can be of two forms, data abstraction and functional abstraction.
a) Data Abstraction:
The representation of the data is hidden.
b) Functional Abstraction:
The implementation is hidden.
C++, 'class' provides data and functional abstraction.
Refer: FRIEND FUNCTIONS AND FRIEND CLASS
2) Encapsulation:
a) Holding the data members and member functions as a single unit.
b) A 'class' holds its data members and member functions as a unit.
Refer: CONSTRUCTORS AND DESTRUCTORS
3) Inheritance:
Inheriting one 'class' properties in another(reusability).
Types of Inheritance:
Refer: INHERITANCE
4) Polymorphism:
One form is used for multiple purposes.
Types of polymorphism:
(ii) operator overloading
Refer: POLYMORPHISM
Refer: