Home | | Computer Science 11th std | C++ Derived Class and Base class

Chapter: 11th Computer Science : Chapter 16 : Inheritance

C++ Derived Class and Base class

While defining a derived class, the derived class should identify the class from which it is derived.

Derived Class and Base class

 

While defining a derived class, the derived class should identify the class from which it is derived. The following points should be observed for defining the derived class.

i. The keyword class has to be used

ii. The name of the derived class is to be given after thekeyword class

iii. A single colon

iv. The type of derivation (the visibility mode ), namely private, public or protected. If no visibility mode is specified ,then by default the visibility mode is considered as private.

v. The names of all base classes(parent classes) separated by comma.

class derived_class_name :visibility_mode base_class_name

{

// members of derivedclass

};

The following are some of the examples for different forms of inheritance

 

Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail
11th Computer Science : Chapter 16 : Inheritance : C++ Derived Class and Base class |


Privacy Policy, Terms and Conditions, DMCA Policy and Compliant

Copyright © 2018-2024 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.