Inheritance is a mechanism through which once class or object can inherits the attributes and behaviors of other class or object. Inheritance comes in the picture mainly when user wants to define common functionality or behaviors and he wants to use it across many implementations.
In Inheritance the class which define the command functionality is known as base class or super class and class which inherits the functionalities and attributes of base class is known as derived class or sub class.
Inheritance allows reusability of the code and inheritance is one of the feature of Object-Oriented Programming (OOPs).
Inheritance is a compile-time mechanism. A super-class can have any number of subclasses. But a subclass can have only one superclass. This is because Java does not support multiple inheritance.
Creating instance of Super class and Subclass
Super class reference an object of subclass