Skip to content

SejalCh/Inheritance_Classes-in-CPP

Repository files navigation

Inheritance_Classes-in-CPP

##AIM:To study about different types of inheritance in C++

##THEORY:

In C++, it is possible to inherit attributes and methods from one class to another. We group the "inheritance" into two categories:
derived class (child) - the class that inherits from another class
base class (parent) - the class being inherited from

Types of inheritance in C++:
1.single inheritance-The inheritance in which a single derived class is inherited from a single base class
2.multiple inheritance-A class can also be derived from more than one base class, using a comma-separated list
3.multilevel inheritance-A class can also be derived from one class, which is already derived from another class.
4.hierarchical inheritance-the type of inheritance that has a hierarchical structure of classes. A single base class can have multiple derived classes, and other subclasses can further inherit these derived classes, forming a hierarchy of classes


Single:
Screenshot 2023-10-24 171900
Multiple:
Screenshot 2023-10-24 171743
Multilevel:
Screenshot 2023-10-24 171840
Hierarchical:
Screenshot 2023-10-24 171709

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy