filmov
tv
Java Tutorial Part35 | OOPS Part4 | Inheritance | Hierarchical Inheritance

Показать описание
Inheritance in Java is a mechanism in which one class acquires all the properties and behaviors of a parent class. It is an important part of OOPs (Object Oriented programming system).
Inheritance represents the IS-A relationship which is also known as a parent-child relationship
Sub Class/Child Class: Subclass is a class which inherits the other class. It is also called a derived class, extended class, or child class.
Super Class/Parent Class: Superclass is the class from where a subclass inherits
syntax of Java Inheritance:
class Subclass-name extends Superclass-name
{
//methods and fields
}
The extends keyword indicates that you are making a new class that derives from an existing class. The meaning of "extends" is to increase the functionality.
On the basis of class, there can be three types of inheritance in java: single, multilevel and hierarchical.
From a single parent class we can create more no of children in Hierarchical structure.
If this video is useful to you, please like and share If you didn't subscribe kindly subscribe. So that you will get a notification about my new videos
#ARIVU_INFO
Inheritance represents the IS-A relationship which is also known as a parent-child relationship
Sub Class/Child Class: Subclass is a class which inherits the other class. It is also called a derived class, extended class, or child class.
Super Class/Parent Class: Superclass is the class from where a subclass inherits
syntax of Java Inheritance:
class Subclass-name extends Superclass-name
{
//methods and fields
}
The extends keyword indicates that you are making a new class that derives from an existing class. The meaning of "extends" is to increase the functionality.
On the basis of class, there can be three types of inheritance in java: single, multilevel and hierarchical.
From a single parent class we can create more no of children in Hierarchical structure.
If this video is useful to you, please like and share If you didn't subscribe kindly subscribe. So that you will get a notification about my new videos
#ARIVU_INFO