4 principles of OOP
Encapsulation:
We wrap code into boxes related to one another. This box can interact with each other using the methods and properties that we make it available.
This makes the code easier to maintain and reusable.
Abstraction:
Hiding the complexity from the user.
Inheritance:
Avoid code rewrite and save memory spaces with shared methods.
Polymorphism: ( Many Forms )
An ability to call a same method in different object, in each object responding different way. This is also known for Method overriding and Method Overloading.
Method overriding is the ability of the inherited class rewriting the virtual method of the base class.
Overloading a method (or function) is the ability for functions of the same name to be defined as long as these methods have different signatures (different set of parameters).
Last updated