Java inheritance
Inheritance isthe process by which one
class acquires the properties of another
class.
This is important because it supports the
concept of hierarchical classification.
The class that is inherited is called
super class/Base class/Parent class.
The class that is inheriting the properties
is called subclass/Derived class/Child
class.
2.
Java inheritance
extends keyword
Theproperties from superclass to the subclass
are inherited using the "extends" keyword.
The general form of inheritance is
class subclass extends superclass
{
//body of the subclass
}
Java inheritance
Java supoortssimple, mutilevel and hierarchical
Inheritances. But Java does not support Multiple and
Hybrid Inheitancies.
5.
Java inheritance
super keyword:The super keyword in Java
is a reference variable which is used to
refer immediate parent class object.
Usage of Java super Keyword
super can be used to refer immediate
parent class instance variable.
super can be used to invoke immediate
parent class method.
super() can be used to invoke immediate
parent class constructor.
6.
Java inheritance
Inheritance isthe process by which one
class acquires the properties of another
class.
This is important because it supports the
concept of hierarchical classification.
The class that is inherited is called
super class/Base class/Parent class.
The class that is inheriting the properties
is called subclass/Derived class/Child
class.