Total Page Preview:   000000000375

What is inheritance in OOPS in English and Hindi



Inheritance in OOPS in English:

Inheritance is a fundamental concept in object-oriented programming that allows creating new classes based on existing ones. In C#, a class can inherit properties and methods from another class, which is called the base class. The class that inherits the base class is called the derived class.
Here is an example of inheritance in C#:

In this example, the Animal class is the base class, and the Dog class is the derived class. The Dog class inherits the Eat method from the Animal class, and it also has its own method called Bark.
When an instance of the Dog class is created, it can call methods from both the Animal and Dog classes. This demonstrates the power and flexibility of inheritance in object-oriented programming.

Inheritance in OOPS in Hindi:

Inheritance ek moolya concept hai object-oriented programming (OOPS) ka jiske dwara ek class dusri class se properties aur methods ko inherit kar sakti hai. C# mai, ek class dusri class se properties aur methods inherit kar sakti hai, jiske liye ek base class aur uske inherited class ka use kiya jata hai.

Yahan ek C# ka inheritance example diya gaya hai:
Is example mai, Animal class base class hai aur Dog class derived class hai. Dog class Animal class se Eat method inherit karti hai aur uske paas khud ka Bark method bhi hota hai.
Jab Dog class ka ek instance banaya jata hai, tab vo Animal aur Dog class ke methods ko dono ko call kar sakta hai. Ye inheritance ka power aur flexibility OOPS mai demonstrate karta hai.

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 :





Facebook User: