In object-oriented programminginheritance enables new objects to take on the properties of existing objects. A class that is used as the basis for inheritance is called a superclass or base class. A class that inherits from a superclass is called a subclass or derived class.

Inheritance means one class can extend to another class. So that the codes can be reused from one class to another class.

Existing class is known as Super class whereas the derived class is known as a sub class.

//Super class:
public class Manipulation(){
}
//Sub class:
public class Addition extends Manipulation(){
}
Inheritance is applicable for public and protected members only. Private members can’t be inherited.

Sources:

https://www.softwaretestinghelp.com/core-java-interview-questions/

« Back to Glossary Index