Total Page Preview:   000000000634

What is single inheritance in OOPS in English and Hindi

 

Single inheritance in OOPS in English:

Single inheritance is a type of inheritance in which a derived class inherits properties and behaviors from a single base class. In C#, the base class is declared using the "base" keyword, and the derived class is declared using the "class" keyword followed by the derived class name and the base class name in parentheses. 

Here's an example:

In the above example, the Dog class inherits from the Animal class using single inheritance. The Dog class has its own method Bark(), but it also has access to the Eat() method of the Animal class, which it inherits. The Main method creates a Dog object and calls both Eat() and Bark() methods.
 
 
 
Single inheritance in OOPS in Hindi:
Single inheritance ek aisi inheritance hai jisme ek derived class keval ek base class se property aur behaviour inherit karti hai. C# mein, base class "base" keyword ka upyog karke declare ki jaati hai, aur derived class "class" keyword ke saath declare ki jaati hai, jisme derived class naam aur base class naam ko parenthesis mein likha jaata hai.
Yahan ek example hai:
Upar ke example mein, Dog class single inheritance ka upyog karke Animal class se inherit hoti hai. Dog class ka apna Bark() method hota hai, lekin Animal class ka Eat() method bhi isme inherit hota hai. Main method Dog object ko create karta hai aur dono Eat() aur Bark() methods ko call 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 : https://www.linkedin.com



Comments


                           
                           

                           

                           

Facebook User: