As we learnt that object oriented programming method is used to solve the problems in the real world using Objects. In a programming language, few concepts are the foundation of the Object Orientation.
Pillars of Object Orientation:
Abstraction is a process in Java used to hide certain details and only show the essential features of the object. In other words, it deals with the outside view of an object.
Abstraction lets you focus on what the object does instead of how it does.
It is a process of wrapping data (variables) and code (methods/function) acting on the data in a single unit.
We can say the process of providing controlled access to the private members of a class.
These can be used to preserve the intellectual properties of a company who develops code.
Inheritance is a mechanism which allows us to inherit the property of one class (which is defined already) to another class (which needs the property or method).
Suppose, we have defined one class parent which has some variables and methods that use that variable, now we are building new class child which needs some methods which are already defined in the parent class, so instead of defining the method again, we will inherit those methods from the parent class.
Polymorphism is the capability of a single method to do different things. We have discussed the method overloading, in that a single method sum() can do different types of sum.