Inheritance In C Plus Plus — Part 1 MCQs with Explanations
Practice high-yield Programming & Software Development MCQs on Inheritance In C Plus Plus — Part 1 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.
Questions
40
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
48 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
40
Verified Practice Questions
Interactive test mode with detailed academic worked solutions
Live Progress|0/40 answered
✓0 correct
✗0 wrong
0% score
🎉 Set complete! All 40 questions answered.
Question 1 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the default access specifier for a base class when inheriting in C++?
Correct Answer: Option A — private
Detailed Academic Explanation:
The correct answer is A: private . Let's break down why: In C++, when you inherit a class without explicitly specifying an access specifier (like `public`, `private`, or `protected`), the default access specifier depends on how you inherit. If you use the `class` keyword to derive a class, the default access specifier is private . For example, if you write `class Derived : Base`, it's the same as writing `class Derived : private Base`. If you use the `struct` keyword to derive a class, the default access specifier is public . This means that if you don't write `public`, `protected`, or `private` before the base class name in the inheritance, the members of the base class become `private` in the derived class (when inheriting with `class`). Therefore, the default access specifier is private .
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 2 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In C++, which type of inheritance allows a class to inherit properties and behavior from multiple base classes?
Correct Answer: Option C — Multiple inheritance
Detailed Academic Explanation:
Multiple inheritance is the correct answer to “In C++, which type of inheritance allows a class to inherit properties and behavior from multiple base classes”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 3 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the access specifier that restricts access to members of a class to only its derived classes in C++?
Correct Answer: Option D — protected
Detailed Academic Explanation:
protected is the correct answer to “What is the access specifier that restricts access to members of a class to only its derived classes in C++”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 4 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the process of defining a new class based on an existing class in C++ called?
Correct Answer: Option A — Inheritance
Detailed Academic Explanation:
Inheritance is the correct answer to “What is the process of defining a new class based on an existing class in C++ called”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 5 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which keyword is used to signify inheritance in C++?
Correct Answer: Option D — : public
Detailed Academic Explanation:
: public is the correct answer to “Which keyword is used to signify inheritance in C++”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 6 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In C++, which access specifier allows members of a base class to be accessible in the derived class but not to the outside world?
Correct Answer: Option D — protected
Detailed Academic Explanation:
protected is the correct answer to “In C++, which access specifier allows members of a base class to be accessible in the derived class but not to the outside world”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 7 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the diamond problem in C++?
Correct Answer: Option C — Ambiguity in multiple inheritance
Detailed Academic Explanation:
Ambiguity in multiple inheritance is the correct answer to “What is the diamond problem in C++”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 8 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the default access specifier for members of a class in C++ when using inheritance?
Correct Answer: Option B — private
Detailed Academic Explanation:
private is the correct answer to “What is the default access specifier for members of a class in C++ when using inheritance”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 9 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What happens if a derived class redefines a method that is already defined in its base class in C++?
Correct Answer: Option C — Method in the derived class overrides the base class method
Detailed Academic Explanation:
Method in the derived class overrides the base class method is the correct answer to “What happens if a derived class redefines a method that is already defined in its base class in C++”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 10 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In C++, which type of inheritance is not supported directly but can be achieved using a combination of other types of inheritance?
Correct Answer: Option D — Hybrid inheritance
Detailed Academic Explanation:
Hybrid inheritance is the correct answer to “In C++, which type of inheritance is not supported directly but can be achieved using a combination of other types of inheritance”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 11 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the name for the process by which a class inherits features from another class in C++?
Correct Answer: Option A — Derivation
Detailed Academic Explanation:
Derivation is the correct answer to “What is the name for the process by which a class inherits features from another class in C++”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 12 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In C++, if a derived class does not define a constructor, which constructor of the base class is called during the object creation of the derived class?
Correct Answer: Option D — Default constructor of the base class
Detailed Academic Explanation:
Default constructor of the base class is the correct answer to “In C++, if a derived class does not define a constructor, which constructor of the base class is called during the object creation of the derived class”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 13 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the process of creating a new class using an existing class as a base in C++?
Correct Answer: Option C — Derived class
Detailed Academic Explanation:
Derived class is the correct answer to “What is the process of creating a new class using an existing class as a base in C++”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 14 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the name given to the feature of C++ where a class inherits features from more than one base class?
Correct Answer: Option B — Multiple inheritance
Detailed Academic Explanation:
Multiple inheritance is the correct answer to “What is the name given to the feature of C++ where a class inherits features from more than one base class”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 15 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In C++, which type of inheritance allows a class to inherit from multiple classes directly or indirectly?
Correct Answer: Option C — Multiple inheritance
Detailed Academic Explanation:
Multiple inheritance is the correct answer to “In C++, which type of inheritance allows a class to inherit from multiple classes directly or indirectly”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 16 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the process of defining a new class by extending an existing class in C++?
Correct Answer: Option D — Derived class
Detailed Academic Explanation:
Derived class is the correct answer to “What is the process of defining a new class by extending an existing class in C++”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 17 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In C++, which access specifier allows the members of a base class to be accessible in the derived class as well as from outside the class?
Correct Answer: Option A — public
Detailed Academic Explanation:
public is the correct answer to “In C++, which access specifier allows the members of a base class to be accessible in the derived class as well as from outside the class”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 18 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the term used to describe a derived class having more than one base class in C++?
Correct Answer: Option D — Multiple inheritance
Detailed Academic Explanation:
Multiple inheritance is the correct answer to “What is the term used to describe a derived class having more than one base class in C++”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 19 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In C++, what is the process of creating a new class from an existing class known as?
Correct Answer: Option C — Inheritance
Detailed Academic Explanation:
Inheritance is the correct answer to “In C++, what is the process of creating a new class from an existing class known as”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 20 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which keyword is used to denote the access specifier in a derived class when inheriting from a base class in C++?
Correct Answer: Option C — extends
Detailed Academic Explanation:
extends is the correct answer to “Which keyword is used to denote the access specifier in a derived class when inheriting from a base class in C++”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 21 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In C++, which type of inheritance involves inheriting from multiple base classes, but only inheriting one level deep from each base class?
Correct Answer: Option B — Multilevel inheritance
Detailed Academic Explanation:
Multilevel inheritance is the correct answer to “In C++, which type of inheritance involves inheriting from multiple base classes, but only inheriting one level deep from each base class”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 22 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the diamond problem in C++ inheritance?
Correct Answer: Option C — A situation where ambiguity arises due to multiple inheritance chains
Detailed Academic Explanation:
A situation where ambiguity arises due to multiple inheritance chains is the correct answer to “What is the diamond problem in C++ inheritance”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 23 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In C++, which access specifier allows the members of a base class to be accessible in the derived class and its derived classes, but not from outside the class hierarchy?
Correct Answer: Option D — protected
Detailed Academic Explanation:
protected is the correct answer to “In C++, which access specifier allows the members of a base class to be accessible in the derived class and its derived classes, but not from outside the class hierarchy”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 24 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In C++, what happens if a derived class inherits multiple base classes and each base class contains a member with the same name?
Correct Answer: Option B — The member of the derived class will access the member from the base class with the same name
Detailed Academic Explanation:
The member of the derived class will access the member from the base class with the same name is the correct answer to “In C++, what happens if a derived class inherits multiple base classes and each base class contains a member with the same name”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 25 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In C++, what is the process of creating a new class using an existing class as a blueprint and adding new functionalities to it?
Correct Answer: Option C — Inheritance
Detailed Academic Explanation:
Inheritance is the correct answer to “In C++, what is the process of creating a new class using an existing class as a blueprint and adding new functionalities to it”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 26 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the term used to describe a class that inherits from another class in C++?
Correct Answer: Option D — Derived class
Detailed Academic Explanation:
Derived class is the correct answer to “What is the term used to describe a class that inherits from another class in C++”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 27 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In C++, what happens if a derived class redefines a method that is already defined in its base class?
Correct Answer: Option C — Method in the derived class overrides the base class method
Detailed Academic Explanation:
Method in the derived class overrides the base class method is the correct answer to “In C++, what happens if a derived class redefines a method that is already defined in its base class”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 28 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In C++, which type of inheritance involves a class inheriting from multiple classes directly or indirectly?
Correct Answer: Option B — Multiple inheritance
Detailed Academic Explanation:
Multiple inheritance is the correct answer to “In C++, which type of inheritance involves a class inheriting from multiple classes directly or indirectly”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 29 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the name given to the process of creating a new class by inheriting properties and behaviors from an existing class in C++?
Correct Answer: Option C — Inheritance
Detailed Academic Explanation:
Inheritance is the correct answer to “What is the name given to the process of creating a new class by inheriting properties and behaviors from an existing class in C++”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 30 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In C++, which access specifier allows the members of a base class to be accessible in the derived class, but not from outside the class?
Correct Answer: Option D — protected
Detailed Academic Explanation:
protected is the correct answer to “In C++, which access specifier allows the members of a base class to be accessible in the derived class, but not from outside the class”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 31 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the term used to describe a class that inherits properties and behaviors from another class in C++?
Correct Answer: Option C — Derived class
Detailed Academic Explanation:
Derived class is the correct answer to “What is the term used to describe a class that inherits properties and behaviors from another class in C++”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 32 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In C++, what is the default access specifier for a base class when inheriting?
Correct Answer: Option C — protected
Detailed Academic Explanation:
protected is the correct answer to “In C++, what is the default access specifier for a base class when inheriting”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 33 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the process called when a new class is created by inheriting properties and behaviors from an existing class in C++?
Correct Answer: Option C — Inheritance
Detailed Academic Explanation:
Inheritance is the correct answer to “What is the process called when a new class is created by inheriting properties and behaviors from an existing class in C++”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 34 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In C++, what is the process called when a class inherits properties and behaviors from multiple base classes?
Correct Answer: Option B — Multiple inheritance
Detailed Academic Explanation:
Multiple inheritance is the correct answer to “In C++, what is the process called when a class inherits properties and behaviors from multiple base classes”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 35 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What happens if a derived class inherits multiple base classes and each base class contains a member with the same name in C++?
Correct Answer: Option B — The member of the derived class will access the member from the base class with the same name
Detailed Academic Explanation:
The member of the derived class will access the member from the base class with the same name is the correct answer to “What happens if a derived class inherits multiple base classes and each base class contains a member with the same name in C++”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 36 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In C++, which access specifier allows the members of a base class to be accessible in the derived class, its derived classes, but not from outside the class hierarchy?
Correct Answer: Option C — protected
Detailed Academic Explanation:
protected is the correct answer to “In C++, which access specifier allows the members of a base class to be accessible in the derived class, its derived classes, but not from outside the class hierarchy”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 37 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In C++, which keyword is used to denote the access specifier in a derived class when inheriting from a base class?
Correct Answer: Option C — extends
Detailed Academic Explanation:
extends is the correct answer to “In C++, which keyword is used to denote the access specifier in a derived class when inheriting from a base class”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 38 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In C++, what happens if a derived class inherits from multiple base classes and each base class has a member with the same name?
Correct Answer: Option B — The member of the derived class will access the member from the base class with the same name
Detailed Academic Explanation:
The member of the derived class will access the member from the base class with the same name is the correct answer to “In C++, what happens if a derived class inherits from multiple base classes and each base class has a member with the same name”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 39 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which type of inheritance involves a class inheriting from multiple classes directly or indirectly in C++?
Correct Answer: Option D — Multiple inheritance
Detailed Academic Explanation:
Multiple inheritance is the correct answer to “Which type of inheritance involves a class inheriting from multiple classes directly or indirectly in C++”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
Question 40 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which specifier makes all the data members and functions of base class inaccessible by the derived class?
Correct Answer: Option A — private
Detailed Academic Explanation:
private is the correct answer to “Which specifier makes all the data members and functions of base class inaccessible by the derived class”. This question is standard in competitive examination syllabi for Inheritance In C Plus Plus.
💡Key Conceptual Anchor:Inheritance In C Plus Plus
✓Link copied to clipboard
Continue Your Practice
Advance Html — Part 1
Master the next curriculum module with 40 exam-standard MCQs.
💡Examiner's Advisory for Programming & Software Development
In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.