OOP
OOP stands for Object-Oriented Programming.
Principles/Concepts of OOP
Encapsulation
wrapping up of data and information under a single unit.
binding together the data and the functions that manipulates them.
Abstraction
abstraction “displays” only the relevant attributes of objects and “hides” the unnecessary details.
Inheritance
Inheritance is one in which a new class is created that inherits the properties of the already exist class. It supports the concept of code reusability and reduces the length of the code in object-oriented programming.
Polymorphism
word Ploy means "Many" and word Morphism means "Form" so it means "Many Forms", the ability to take more than one form.
We can achieve Polymorphism through:
- Function Overloading
- Operator Overloading
- Overriding
- Virtual Methods
Interfaces: Pure Virtual Functions and Abstract Classes
A pure virtual function doesn't have the function body and it must end with = 0.
If you have one pure virtual function in a class then it will be converted to abstract class.