English

Explain different types of inheritance with suitable diagram. - Computer Science 1

Advertisements
Advertisements

Questions

Explain different types of inheritance with suitable diagram.

Explain any three type of inheritance with suitable diagram.

Explain
Advertisements

Solution

  1. The mechanism of deriving a new class from an old one is called inheritance. The old class is referred to as the base class, and the new class is referred to as the derived class. C++ strongly supports the concept of reusability. This is basically done by creating new classes and reusing the properties of the existing ones. Functions and variables of a class that has been tested can be used by an object of another class. This is known as inheritance. Reusing a class that has already been tested, debugged, and used many times can save the effort of redeveloping and retesting it.
  2. One of the most useful features of classes is inheritance. It is possible to declare a class that inherits the properties of another class or classes. This means that, with good class design, you can build applications based on proven reusable code. i.e., the main purpose of inheritance is code reusability.

Different forms of Inheritance:

  1. Single inheritance
  2. Multiple Inheritance
  3. Hierarchical Inheritance
  4. Multilevel Inheritance
  5. Hybrid Inheritance
shaalaa.com
  Is there an error in this question or solution?
2016-2017 (March)
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×