Inheritance In Java

OOP’S Concept Inheritance

 

  • Can access the property of one class into another class.
  • To achieve Inheritance In Java extends keyword is use in java

Extend Keyword

  • Can Access only non-private properties of parent class into child class.
  • There are total 5 types of inheritance in OOPs and from this only 3 are directly allowed in java.

type of inheritance

  • In Java one class can extend only one class at a time. (Once class can extends maximum one class)
  • Constructors are not a part of inheritance (Constructor never inherits)
  • Multiple and Hybrid inheritance is not supported in java directly, but it can be achieved by Interface.
  • Multiple and Hybrid inheritance is not allowed in java due to ambiguity/confusion in accessing the same properties.
  • After Inheritance IS-A relation applies between Parent and child class.

Is A Relation

  • Advantage of Inheritance
    1. Code reusability, extensibility.
    2. Inheritance is required to achieve runtime polymorphism.

Single Inheritance In Java

 

 

Join Telegram : Click Here

 

All Full Stack Java Study Material

 

Java the programing language

 

Job’s For Fresher

 

Share This Information To Your Friends and Your College Group’s, To Help Them !