When trying to remember the four principles of object oriented programming just think of APIE.
A is for Abstraction: Abstraction is a process of hiding the implementation details from the user, only the functionality will be provided to the user. In other words, the user will have the information on what the object does instead of how it does it.
P is for Polymorphism: Polymorphism stands for the phrase “many forms”. This allow for subclasses to define its own behavior of attributes inherited from its parent class. This involves method overloading and overriding.

Notice how the two child classes inherited the method Sum() from their parent class. Both child classes changed the behavior of the method to do something specifically for their class.
I is for Inheritance: Inheritance is the ability of creating a class from an existing class and acquire its parent’s class behavior. This allows classes to be re-usable and modular since you can reuse classes and reduce development time.

Notice how all the different types of vehicles can be generalized to one simple term vehicle. That’s considered the parent class and anything that fall underneath it are just different variations of vehicle which are known as the child classes.
E is for Encapsulation: Encapsulation it describes the idea of bundling data and methods that work on that data within one unit. Encapsulation is also known for data hiding since it allows you to mark variables as private, this means the variables of a class will be hidden from other classes and can be accessed only through the methods of their current class.

In the image you can’t have access to the variables but, you can have access to the methods that use those variables.
You may be wondering Abstraction and Encapsulation sounds like they are the same thing right?
When you think of encapsulation just imagine these two facts:
- Declare the variables of a class private.
- Provide public setters and getters methods to modify and view the variables values.
When you think of abstraction just imagine this scenario:
Abstraction refers to the idea of simplifying things enough so that the user just know that something works but doesn’t know the process of the things done in the background.
For example sending a text message, when you type a text and send the message. You don’t know the internal processing about the message delivery.
Abstraction lets you focus on what the object does instead of how it does it.
If you have any questions or want to add something new please write it down in the comment section.