Inheritance – what does the word mean to you? Are you thinking of inheriting property or about the book “Inheritance of Loss.” ? Well, though both the inheritances exist, we will discuss about Inheritance as an Object Oriented Programming (OOPS ) concept.
A Class is the basic unit of OOPS. A class will have member data. Member data describes the characteristics of the class. The original class is called base class. The inherited class is known as derived class.
Imagine that 'Bird' is a base class. Then peacock, hen, and sparrow inherit attributes from the base class of birds. Here peacock and sparrow are derived classes. A derived class will have all the attributes of a base class, and few new attributes also. For example, peacock has a new attribute of dancing. Koel has a new attribute of singing.
Inheritance is similar to a child inheriting qualities from both dad and mom. You call it multiple inheritance – when you inherit from more than one base class ( mom and dad).
The code or syntax for inheritance may vary across C++, C#, and Java. But, the concept of inheritance remains the same across all languages.
Do you want to learn OOPS concepts applied in .NET? Learn .NET from Softlogic Systems IT Training company in Chennai. They have trained a lot of freshers in .NET and have placed them. For more details visit Softlogic Systems Chennai or dial +91 8681884318.
A Class is the basic unit of OOPS. A class will have member data. Member data describes the characteristics of the class. The original class is called base class. The inherited class is known as derived class.
Imagine that 'Bird' is a base class. Then peacock, hen, and sparrow inherit attributes from the base class of birds. Here peacock and sparrow are derived classes. A derived class will have all the attributes of a base class, and few new attributes also. For example, peacock has a new attribute of dancing. Koel has a new attribute of singing.
Inheritance is similar to a child inheriting qualities from both dad and mom. You call it multiple inheritance – when you inherit from more than one base class ( mom and dad).
The code or syntax for inheritance may vary across C++, C#, and Java. But, the concept of inheritance remains the same across all languages.
Do you want to learn OOPS concepts applied in .NET? Learn .NET from Softlogic Systems IT Training company in Chennai. They have trained a lot of freshers in .NET and have placed them. For more details visit Softlogic Systems Chennai or dial +91 8681884318.