Official CBSE Study Materials for Class 12 Computer Science
Access comprehensive study materials and useful resources for Inheritance using the Class 12 Inheritance Revision Notes. Designed to align with the 2026-27 CBSE academic guidelines, these advanced resources help Class 12 Computer Science students reinforce core concepts beyond standard textbooks.
Advanced Resources for Computer Science
Navigate directly to the advanced Computer Science study materials using the digital viewer below. Each resource pack includes detailed conceptual summaries and solved practice questions, allowing students to instantly reinforce their learning.
This Class 12 Computer Science revision notes page covers Chapter 4, Inheritance, from Unit-I (Object Oriented Programming in C++). It explains the meaning and advantages of inheritance, the five types of inheritance (single, multiple, hierarchical, multilevel and hybrid), the syntax for defining a derived class, visibility modes, constructor and destructor order in derived classes, and solved short answer questions with a code-based question on the employee and manager classes.
Unit-I
Objective Oriented Programming in C++
Chapter 04: Inheritance
Inheritance is the process of creating a new class from existing class or classes. The existing class is known as the base, super or parent class, and the newly created class is known as the derived, sub or child class. The derived class inherits the properties of the base class.
Advantages of Inheritance
Reusability: It helps the code to be reused in the derived class. The base class is defined and once it is compiled, it does not need to be reworked.
Transitivity: If class B inherits the properties of another class A, then all subclasses of class B will automatically inherit the properties of A. This is called the transitive property.
Types of Inheritance
1. Single inheritance: When a sub class inherits from only one base class, it is known as single inheritance.
2. Multiple inheritance: When a sub class inherits from multiple base classes, it is known as multiple inheritance.
3. Hierarchical inheritance: When many sub classes inherit from a single class, it is known as hierarchical inheritance.
4. Multilevel inheritance: When a class inherits from a class that itself inherits from another class, it is known as multilevel inheritance.
5. Hybrid inheritance: It is a combination of two or more of the above types of inheritance. There is no fixed pattern of deriving from classes.
Syntax for Defining a Derived Class
class <derived class name>:<visibility mode><base class name>
{
//Data members of derived class
//Member functions of derived class
};
Visibility Modes
The visibility mode in the definition of the derived class specifies whether the features of the base class are privately derived, publicly derived or protected derived.
| Visibility Mode | Public member of base class becomes | Protected member of base class becomes | Private member of base class |
|---|---|---|---|
| Public | Public in derived class | Protected in derived class | Are not directly accessible to derived class |
| Protected | Protected in derived class | Protected in derived class | |
| Private | Private in derived class | Private in derived class |
Constructor and Destructor in Derived Classes
When a base class and a derived class both have a constructor and a destructor, the constructors are executed in order of inheritance and the destructors are executed in reverse order. That is, the base class constructor is executed before the constructor of the derived class, and the destructor of the derived class is executed before the base class destructor.
Short Anwer Type Questions(2 Marks)
Q1.What do you understand by Inheritance? [2 Marks]
Answer:
1. Inheritance is the process of creating a new class from one or more existing classes.
2. The existing class is called the base class, and the new class is called the derived class.
3. The derived class inherits the properties (data members and member functions) of the base class, which allows the code to be reused.
Teacher's Note:
a) Mention both the existing class and the new class in the definition.
b) Add reusability as the main benefit to earn the second mark.
Q2.What is Base class and derived class? [2 Marks]
Answer:
1. Base class: The existing class whose properties are inherited. It is also called the super or parent class.
2. Derived class: The newly created class that inherits the properties of the base class. It is also called the sub or child class.
Teacher's Note:
a) Define each term separately and give the alternative names used in textbooks.
b) Keep the direction clear: the base class gives, the derived class receives.
Q3.What is difference between Multiple Inheritance and Multilevel Inheritance? [2 Marks]
Answer:
1. Multiple inheritance: A derived class inherits directly from two or more base classes at the same time, so it has several parents.
2. Multilevel inheritance: A class is derived from a derived class, forming a chain such as A, then B derived from A, then C derived from B, so each class has only one parent but there are several levels.
Teacher's Note:
a) Multiple inheritance has many parents at one level; multilevel inheritance has one parent per level in a chain.
b) A simple class diagram or a chain such as A to B to C makes the difference easy to remember.
Q4.What is difference between public access specifier and private access specifier? [2 Marks]
Answer:
1. Public access specifier: Members declared as public can be accessed from anywhere in the program, including outside the class and in the derived classes.
2. Private access specifier: Members declared as private can be accessed only within the class in which they are declared. They are not directly accessible from outside the class or in derived classes.
Teacher's Note:
a) Public means open access; private means access is restricted to the class itself.
b) Name one example of an access outside the class for each specifier to show the difference clearly.
Q5.Which type of Inheritance is depicted below? [2 Marks]
Answer:
1. The diagram shows Student as the base class of Arts, Science and Commerce, which is hierarchical inheritance.
2. Science is also a base class of Medical and Non Medical, which is multilevel inheritance.
3. A combination of these two types is hybrid inheritance.
Teacher's Note:
a) The answer is hybrid inheritance because two types appear in the same diagram.
b) Name both parts (hierarchical at the top, multilevel below Science) to show the reasoning.
Q6.Consider the following code and answer the questions below: [2 Marks]
#include<iostream.h>
class employee
{ int emp_no;
char emp_name[25], emp_addr[30], emp_dept[10];
public:
void emp_input();
void emp_print();
};
class manager: public employee
{ int no_of_emp;
public:
void input();
void print();
};
i. Which type of inheritance is shown in the above code?
ii. Name the base class and the derived class
iii. Name all the private data members of class employee
iv. Name all public member functions of class manager?
Answer:
i. Single inheritance, because the class manager is derived from only one base class, employee.
ii. Base class: employee. Derived class: manager.
iii. Private data members of class employee: emp_no, emp_name, emp_addr and emp_dept.
iv. Public member functions of class manager: input() and print(). The functions emp_input() and emp_print() belong to the base class employee, not to manager.
Teacher's Note:
a) Read the code from top to bottom and list each member under the correct access label before answering part iii.
b) The header in the code is written as iostream.h; modern C++ programs use <iostream> without the .h extension.
Free study material for Computer Science
CBSE Class 12 Computer Science Study Material: Inheritance
Essential Notes for Class 12 Computer Science
Review targeted study resources for Inheritance tailored for Class 12 learners. Utilizing these structured notes and quick-revision tools ensures complete alignment with current CBSE evaluation standards.
Verified Solutions for Class 12 Computer Science
Each resource draws directly from authorized textbooks to maintain academic accuracy. Evaluating solved examples allows Class 12 students to master the formal presentation and answer-writing standards expected in upcoming school exams.
Enhance Accuracy with Online Tests
For peak performance in upcoming evaluations, integrate official Computer Science sample papers directly into your study schedule. Follow up your revision by attempting online MCQ tests for Inheritance to refine calculation speed and precision.
FAQs
Our advanced study package for Inheritance includes detailed concepts, diagrams, Mind Maps, and explanation of complex topics to ensure Class 12 students learn as per syllabus for 2026 exams.
The Mind Maps provided for Inheritance act as visual anchors which will help faster recall during high-pressure exams.
Yes, teachers use our Class 12 Computer Science resources for lesson planning as they are in simple language and have lot of solved examples.
Yes, You can download the complete, mobile-friendly PDF of the Computer Science Inheritance advanced resources for free.
Yes, our subject matter experts have updated the Inheritance material to align with the rationalized NCERT textbooks and have removed deleted topics and added new competency-based questions.