The class from which the data members and member functions are used by another class is called the base class.
Base and
Derived Classes
•
The class from which the data members and member functions are used by another
class is called the base class.
•
The class which uses the properties of base class and at the same time can add
its own properties is called derived
class.
•
There are three types of access specifier
or qualifier using which the members of the class are accessed by the other
class ‒
1.
Private
2.
Public
3.
Protected
•
If a base class has private members then
those members are not accessible to derived class.
•
Protected
members are public to derived classes but private to rest of the program.
•
Public
members are accessible to all.
•
The derived class can inherit base class publicly or privately. The notation
used for inheritance is :
class
d1:public b1
class
d2:private b2
The
first line indicates that there are two classes d1 and b1. It means
"the derived class d1 inherits
the base class b1 publicly".
The
second line indicates that there are two classes d2 and b2. It means
"the derived class d2 inherits
the base class b2 privately."
•
The base class and derived class can
generate their own objects. These objects differ from each other.
Review Question
1. Explain the terms
base class and derived class.
Object Oriented Programming: Chapter 3: Inheritance and Compile Time Polymorphism : Tag: Oops, Computer Programming : C++ Programming | Object Oriented Programming - Base and Derived Classes
Object Oriented Programming (OOPs)
CS25C07 2nd Semester CSE, CSE(CY) Depts | 2025 Regulation | 2nd Semester 2025 Regulation
English Essentials II
EN25C02 2nd Semester | 2025 Regulation | 2nd Semester 2025 Regulation
Tamils and Technology தமிழர்களும் தொழில்நுட்பமும்
UC25H02 2nd Semester | 2025 Regulation | 2nd Semester 2025 Regulation
Linear Algebra
MA25C02 2nd Semester | 2025 Regulation
Applied Physics (CSIE) II
PH25C03 2nd Semester AIDS, CSE, IT, CSE(CY) Dept | 2025 Regulation | 2nd Semester 2025 Regulation
Digital Principles and Computer Organization
CS25C06 2nd Semester AIDS, CSE, IT, CSE(CY) Dept | 2025 Regulation | 2nd Semester 2025 Regulation
Basic Electrical and Electronics Engineering
EE25C01 2nd Semester | 2025 Regulation | 2nd Semester 2025 Regulation
Object Oriented Programming (OOPs)
CS25C07 2nd Semester CSE, CSE(CY) Depts | 2025 Regulation | 2nd Semester 2025 Regulation
Re-Engineering for Innovation
ME25C05 2nd Semester | 2025 Regulation | 2nd Semester 2025 Regulation
Object Oriented Programming (OOPs) - Laboratory
CS25C07 2nd Semester CSE, CSE(CY) Depts | 2025 Regulation | 2nd Semester 2025 Regulation