Explain Inheritance, Encapsulation, Polymorphism and Abstraction in java

Inheritance is the process by which objects of one class acquire the properties of objects of another class. A class that is inherited is called a super class  The class that does the inheriting is called a subclass. Inheritance is done by using the keyword extends.

Abstraction - The process of representing essential features without including the implementation details or explanations. Abstraction means to show only the necessary details.

Polymorphism is the ability of an object to take on many forms. It is described as one interface, many implementations.

Encapsulation is also known as data hiding. It’s a mechanism used to restrict the access to class’s properties and behaviors and allowing outside access only as appropriate.
 

Search Topics

Popular Posts