or a colleague then this is something worth your time recalling.
So What are the 4 pillars of OOP ?
Abstraction
Abstraction is a process of exposing essential feature of an entity while hiding other irrelevant detail. Why would you want to use abstraction?
abstraction reduces code complexity and at the same time it makes your aesthetically pleasant.
Encapsulation
We have to take in consideration that Encapsulation is somehow related to Data Hiding.
Encapsulation is when you hide your modules internal data and all other implementation details/mechanism from other modules.
it is also a way of restricting access to certain properties or component.
Remember, Encapsulation is not data hiding, but Encapsulation leads to data hiding
Inheritance
The ability of creating a new class from an existing class.
Like the word Inheritance literally means it is a practice of passing on property, titles, debts, rights and obligations upon the death of an individual. In OOP this is somehow true(Except the death of an individual), where The base class(the existing class sometimes called as the Parent class) has properties and methods that will be inherited by the sub class(sometimes called a subtype or child class) and it can have additional properties or methods. Inheritance is also a way to use code of an existing objects.
Polymorphism
Just like in biology, Polymorphism refers to the ability to take into different forms or stages.A subclass can define its own unique behaviour and still share the same functionalities or behavior of its
parent/base class. Yes, you got it right, subclass can have their own behavior and share
some behaviour from its parent class But, not vice versa. A parent class cannot have the behaviour
of its subclass.
This is enough for you to recall everything you have forgotten about the pillars of OOP ;-p