Total Page Preview:   000000000518

Explain the basic type of inheritance in OOPS in English and Hindi

 

 

 

Basic type of inheritance in English:

Sure, let me explain the different types of inheritance in OOP along with a full diagram.

 
Inheritance is a mechanism in object-oriented programming that allows one class (the child or derived class) to inherit properties and behaviors from another class (the parent or base class). There are four types of inheritance in OOP, which are:
 
1-Single Inheritance
 
2-Multiple Inheritance
 
3-Multilevel Inheritance
 
4-Hierarchical Inheritance
 
 
Let's explain each type of inheritance with a diagram.
 
 
 
1-Single Inheritance:
 
In Single Inheritance, a child class inherits properties and behaviors from a single parent class. The diagram below illustrates single inheritance:
 
 
 
 
In the above diagram, the Child Class inherits the properties and behaviors of the Parent Class through the inheritance arrow.
 
 
Multiple Inheritance:
 
In Multiple Inheritance, a child class inherits properties and behaviors from multiple parent classes. The diagram below illustrates multiple inheritance:
 
 
In the above diagram, the Child Class inherits properties and behaviors from two Parent Classes (Parent Class1 and Parent Class2).
 
 
Multilevel Inheritance:
 
In Multilevel Inheritance, a child class inherits properties and behaviors from a parent class, which in turn inherits properties and behaviors from another parent class. The diagram below illustrates multilevel inheritance:
 
 
 
In the above diagram, the Child Class inherits properties and behaviors from the GrandParent Class through the Parent Class.
 
 
Hierarchical Inheritance:
 
In Hierarchical Inheritance, multiple child classes inherit properties and behaviors from a single parent class. The diagram below illustrates hierarchical inheritance:
 
 
 
 
 
 
 
 
Basic type of inheritance in Hindi:
 
 
Inheritance ke bahut se prakar hote hai aur yeh programming languages ke upyog ke anusaar badalte hai. Lekin main yahaan kuch common types of inheritance ke baare mein batata hoon.
 
 
1-Single Inheritance:
 
Is prakar mein ek base class hoti hai aur uss class se derived class banti hai. Is prakar ke inheritance ko Upari Waris Ke Roop Mein Ek Waris ko bhi kaha jaata hai.
 
Example diagram:
 
 
 
2-Multi-level Inheritance:
 
Is prakar mein ek base class hoti hai aur uss class se derived class banti hai, phir uss derived class se dusri class banti hai. Is prakar ke inheritance ko anuprayukt waris ke roop mein bhi kaha jaata hai.
 
Example diagram:
 
 
 
3-Hierarchical Inheritance:
 
Is prakar mein ek base class hoti hai aur uss class se do ya do se adhik derived class banti hai. isi ko hum heirarchical inheritance kahte hai.
 
Example diagram:
 
 
 
4-Multiple Inheritance:
 
Is prakar mein ek class se do ya do se adhik class banti hai. Yeh prakar ke inheritance ko sahaj anuprayog ke roop mein bhi kaha jaata hai.
 
Example diagram:
 
 
 
 
 
 
 
 
 
 

Thank You

About Author

Brijesh Kumar

Database Developer

I have more then 6 years Experience in Microsoft Technologies - SQL Server Database, ETL Azure Cloud - Azure SQL Database, CosmosDB, Azure Data Factory, PowerBI, Web Job, Azure Function, Azure Storage, Web Apps, Powershall and Database Migration On-Premise to Azure Cloud.
LinkedIn : https://www.linkedin.com



Comments


                           
                           

                           

                           

Facebook User: