Object Oriented Programming In C Plus Plus — Part 1 MCQs with Explanations
Practice high-yield Programming & Software Development MCQs on Object Oriented Programming 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
Which keyword is used to inherit a class in C++?
Correct Answer: Option A — public
Detailed Academic Explanation:
In C++, the keyword public is used to specify public inheritance when inheriting a class. When a class inherits another class publicly, all public members of the base class become public members of the derived class, and protected members of the base class become protected members of the derived class. The keywords private and protected can also be used for inheritance, but they specify different levels of access control: private inheritance : All public and protected members of the base class become private members of the derived class. protected inheritance : All public and protected members of the base class become protected members of the derived class. The keyword extends is used in languages like Java for inheritance, but not in C++. Therefore, the correct answer is public .
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 2 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which keyword is used to define a class in C++?
Correct Answer: Option A — class
Detailed Academic Explanation:
class is the correct answer to “Which keyword is used to define a class in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 3 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the process of creating an instance of a class called in C++?
Correct Answer: Option D — Instantiation
Detailed Academic Explanation:
Instantiation is the correct answer to “What is the process of creating an instance of a class called in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 4 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is inheritance in C++?
Correct Answer: Option C — The process of deriving a new class from an existing class
Detailed Academic Explanation:
The process of deriving a new class from an existing class is the correct answer to “What is inheritance in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 5 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the access specifier that allows members to be accessed from outside the class in C++?
Correct Answer: Option B — public
Detailed Academic Explanation:
public is the correct answer to “What is the access specifier that allows members to be accessed from outside the class in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 6 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which concept in C++ allows a class to have multiple functions with the same name but different parameter lists?
Correct Answer: Option C — Overloading
Detailed Academic Explanation:
Overloading is the correct answer to “Which concept in C++ allows a class to have multiple functions with the same name but different parameter lists”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 7 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is encapsulation in C++?
Correct Answer: Option D — The bundling of data with the methods that operate on that data
Detailed Academic Explanation:
The bundling of data with the methods that operate on that data is the correct answer to “What is encapsulation in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 8 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is polymorphism in C++?
Correct Answer: Option A — The ability of a function to perform different tasks based on the object that it is acting upon
Detailed Academic Explanation:
The ability of a function to perform different tasks based on the object that it is acting upon is the correct answer to “What is polymorphism in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 9 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is true about constructors in C++?
Correct Answer: Option D — They are automatically called when an object is created
Detailed Academic Explanation:
They are automatically called when an object is created is the correct answer to “Which of the following is true about constructors in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 10 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the process of wrapping data and functions into a single unit called in C++?
Correct Answer: Option C — Encapsulation
Detailed Academic Explanation:
Encapsulation is the correct answer to “What is the process of wrapping data and functions into a single unit called in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 11 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is dynamic polymorphism in C++?
Correct Answer: Option B — The ability of a function to perform different tasks based on the object that it is acting upon at runtime
Detailed Academic Explanation:
The ability of a function to perform different tasks based on the object that it is acting upon at runtime is the correct answer to “What is dynamic polymorphism in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 12 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which keyword is used to specify that a function cannot be overridden in a derived class in C++?
Correct Answer: Option C — final
Detailed Academic Explanation:
final is the correct answer to “Which keyword is used to specify that a function cannot be overridden in a derived class in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 13 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is an abstract class in C++?
Correct Answer: Option D — A class that cannot be instantiated and is used as a base class for other classes
Detailed Academic Explanation:
A class that cannot be instantiated and is used as a base class for other classes is the correct answer to “What is an abstract class in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 14 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of friend functions in C++?
Correct Answer: Option A — To allow access to private and protected members of a class from outside the class
Detailed Academic Explanation:
To allow access to private and protected members of a class from outside the class is the correct answer to “What is the purpose of friend functions in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 15 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the access specifier that allows members to be accessed only within the same class or by derived classes in C++?
Correct Answer: Option D — protected
Detailed Academic Explanation:
protected is the correct answer to “What is the access specifier that allows members to be accessed only within the same class or by derived classes in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 16 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is a constructor in C++?
Correct Answer: Option C — A special member function that initializes objects
Detailed Academic Explanation:
A special member function that initializes objects is the correct answer to “What is a constructor in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 17 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which keyword is used to access the base class members from a derived class in C++?
Correct Answer: Option D — base
Detailed Academic Explanation:
base is the correct answer to “Which keyword is used to access the base class members from a derived class in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 18 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is operator overloading in C++?
Correct Answer: Option B — Defining multiple functions with the same name but different arguments
Detailed Academic Explanation:
Defining multiple functions with the same name but different arguments is the correct answer to “What is operator overloading in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 19 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of a destructor in C++?
Correct Answer: Option C — To clean up resources before an object is destroyed
Detailed Academic Explanation:
To clean up resources before an object is destroyed is the correct answer to “What is the purpose of a destructor in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 20 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which access specifier allows a member to be accessible only within its own class and derived classes in C++?
Correct Answer: Option D — protected
Detailed Academic Explanation:
protected is the correct answer to “Which access specifier allows a member to be accessible only within its own class and derived classes in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 21 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is function overriding in C++?
Correct Answer: Option A — Defining a function in the derived class with the same signature as in the base class
Detailed Academic Explanation:
Defining a function in the derived class with the same signature as in the base class is the correct answer to “What is function overriding in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 22 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of the 'static' keyword in C++?
Correct Answer: Option D — To create class-level variables and functions
Detailed Academic Explanation:
To create class-level variables and functions is the correct answer to “What is the purpose of the 'static' keyword in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 23 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the difference between 'struct' and 'class' in C++?
Correct Answer: Option C — Structs have all members public by default, while classes have them private by default
Detailed Academic Explanation:
Structs have all members public by default, while classes have them private by default is the correct answer to “What is the difference between 'struct' and 'class' in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 24 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of the 'virtual' keyword in C++?
Correct Answer: Option C — To enable polymorphism through function overriding
Detailed Academic Explanation:
To enable polymorphism through function overriding is the correct answer to “What is the purpose of the 'virtual' keyword in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 25 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which concept allows a derived class to inherit properties and behavior from a base class in C++?
Correct Answer: Option B — Inheritance
Detailed Academic Explanation:
Inheritance is the correct answer to “Which concept allows a derived class to inherit properties and behavior from a base class in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 26 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the correct syntax for inheriting a class in C++?
Correct Answer: Option C — class Derived : public Base {}
Detailed Academic Explanation:
class Derived : public Base {} is the correct answer to “What is the correct syntax for inheriting a class in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 27 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of access specifiers in C++ classes?
Correct Answer: Option D — To control the visibility of class members
Detailed Academic Explanation:
To control the visibility of class members is the correct answer to “What is the purpose of access specifiers in C++ classes”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 28 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of the 'friend' keyword in C++?
Correct Answer: Option D — To allow a function or class to access private and protected members of another class
Detailed Academic Explanation:
To allow a function or class to access private and protected members of another class is the correct answer to “What is the purpose of the 'friend' keyword in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 29 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the concept of data hiding in C++?
Correct Answer: Option C — Encapsulation
Detailed Academic Explanation:
Encapsulation is the correct answer to “What is the concept of data hiding in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 30 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which keyword is used to access the superclass constructor in a derived class constructor in C++?
Correct Answer: Option B — super
Detailed Academic Explanation:
super is the correct answer to “Which keyword is used to access the superclass constructor in a derived class constructor in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 31 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the access specifier that restricts access to members of a class to only its friend classes and member functions in C++?
Correct Answer: Option C — private
Detailed Academic Explanation:
private is the correct answer to “What is the access specifier that restricts access to members of a class to only its friend classes and member functions in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 32 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the term "this" pointer refer to in C++?
Correct Answer: Option C — Pointer to the current object instance
Detailed Academic Explanation:
Pointer to the current object instance is the correct answer to “What does the term "this" pointer refer to in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 33 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which type of inheritance allows a class to inherit properties and behavior from multiple base classes in C++?
Correct Answer: Option D — Multiple inheritance
Detailed Academic Explanation:
Multiple inheritance is the correct answer to “Which type of inheritance allows a class to inherit properties and behavior from multiple base classes in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 34 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the difference between an object and a class in C++?
Correct Answer: Option C — A class is a blueprint for creating objects, whereas an object is an instance of a class
Detailed Academic Explanation:
A class is a blueprint for creating objects, whereas an object is an instance of a class is the correct answer to “What is the difference between an object and a class in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 35 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the process of hiding the implementation details of a class and showing only the necessary features to the outside world called in C++?
Correct Answer: Option D — Abstraction
Detailed Academic Explanation:
Abstraction is the correct answer to “What is the process of hiding the implementation details of a class and showing only the necessary features to the outside world called in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 36 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of using virtual functions in C++?
Correct Answer: Option A — To achieve runtime polymorphism
Detailed Academic Explanation:
To achieve runtime polymorphism is the correct answer to “What is the purpose of using virtual functions in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 37 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which keyword is used to prevent a class from being instantiated in C++?
Correct Answer: Option C — final
Detailed Academic Explanation:
final is the correct answer to “Which keyword is used to prevent a class from being instantiated in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 38 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which operator is used to access members of a class through a pointer in C++?
Correct Answer: Option D — Arrow operator (->)
Detailed Academic Explanation:
Arrow operator (->) is the correct answer to “Which operator is used to access members of a class through a pointer in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 39 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the term for the ability of a class to provide different implementations of a function depending on the types of its parameters in C++?
Correct Answer: Option C — Function overloading
Detailed Academic Explanation:
Function overloading is the correct answer to “What is the term for the ability of a class to provide different implementations of a function depending on the types of its parameters in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming In C Plus Plus
Question 40 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which access specifier allows members of a class to be accessed from anywhere in the program in C++?
Correct Answer: Option B — public
Detailed Academic Explanation:
public is the correct answer to “Which access specifier allows members of a class to be accessed from anywhere in the program in C++”. This question is standard in competitive examination syllabi for Object Oriented Programming In C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming 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.