Object-Oriented Programming Principles

Abstraction can be defined as hiding internal implementation and showing only the required features or set of services that are offered. This is the most essential part of Object-Oriented programming.
 
Encapsulation can be defined as the binding of data and attributes or methods and data members in a single unit. In classes, we have Data and attributes that perform operations on that data. So according to the OOPs principle of Encapsulation, that data can be merged into a single unit. Encapsulation enhances more security of the data as everything related to a single task must be grouped and access to the data is given as per need.
 
Inheritance is the method of acquiring features of the existing class into the new class. Suppose there is a class, considered as the parent class, that has some methods associated with it. And we declare a new class, considered as the child class, that has its own methods. So, when a child class is inherited from the parent class then it will have all the methods associated with parent class are available in the child class along with the child class own methods also. So that is Inheritance.
 
Polymorphism refers to one name with many forms. It is the ability of one function to perform in different ways. In other words, it refers to an object’s ability to take on more than one single form.
 
Polymorphism can be applied in two simple ways
Method Overloading
Method Overriding