Inheritance can be defined as the process where one class acquires the properties (methods and fields) of another.
TYPES OF INHERITANCE :
- SINGLE INHERITANCE : When a class extends another one class only then we call it a single inheritance.

- MULTILEVEL INHERITANCE : Multilevel inheritance refers to a mechanism in OO technology where one can inherit from a derived class.

- HEIRARCHICAL INHERITANCE : In such kind of inheritance one class is inherited by many sub classes.

- HYBRID INHERITANCE : Hybrid inheritance is a combination of Single and Multiple inheritance.

METHOD OVERRIDING
If subclass has the same method as declared in the parent class, it is known as method overriding in java. It is used for runtime polymorphism.
Example :
class A{
void run(){System.out.println("A");}
}
class B extends A{
void run(){System.out.println("B");}
public static void main(String args[]){
B obj = new B();
obj.run();
}
Output :
B