Skip to main content

Constructors And Destructors In C Plus Plus — Part 1 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Constructors And Destructors 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
Question 1 of 40
★ FPSC ★ PPSC

What is the access specifier that allows constructors to be called only from member functions of the same class and its derived classes in C++?

Question 2 of 40
★ FPSC ★ PPSC

Which access specifier allows constructors to be called from anywhere in the program in C++?

Question 3 of 40
★ FPSC ★ PPSC

What happens if a class does not explicitly declare any constructors in C++?

Question 4 of 40
★ FPSC ★ PPSC

What is the purpose of the 'explicit' keyword before a constructor in C++?

Question 5 of 40
★ FPSC ★ PPSC

Which keyword is used to prevent inheritance in C++?

Question 6 of 40
★ FPSC ★ PPSC

What is the difference between a shallow copy and a deep copy in C++?

Question 7 of 40
★ FPSC ★ PPSC

What is a constructor initialization list in C++?

Question 8 of 40
★ FPSC ★ PPSC

What is the access specifier that allows members of a class to be accessed from anywhere in the program in C++?

Question 9 of 40
★ FPSC ★ PPSC

What is the purpose of using the 'explicit' keyword in front of a constructor declaration in C++?

Question 10 of 40
★ FPSC ★ PPSC

Which type of constructor is automatically called when an object is created without any arguments in C++?

Question 11 of 40
★ FPSC ★ PPSC

Which of the following statements about destructors in C++ is true?

Question 12 of 40
★ FPSC ★ PPSC

In C++, what is the purpose of the 'this' pointer in a class member function?

Question 13 of 40
★ FPSC ★ PPSC

Which keyword is used to prevent a class from being inherited in C++?

Question 14 of 40
★ FPSC ★ PPSC

In C++, what is the difference between a shallow copy and a deep copy?

Question 15 of 40
★ FPSC ★ PPSC

What is the difference between a constructor and a normal member function in C++?

Question 16 of 40
★ FPSC ★ PPSC

What happens if a class does not define any constructors in C++?

Question 17 of 40
★ FPSC ★ PPSC

What is the purpose of using constructor initialization lists in C++?

Question 18 of 40
★ FPSC ★ PPSC

What is the destructor called automatically when an object is destroyed in C++?

Question 19 of 40
★ FPSC ★ PPSC

Which keyword is used to prevent an object from being copied in C++?

Question 20 of 40
★ FPSC ★ PPSC

What happens if a destructor is made private in a C++ class?

Question 21 of 40
★ FPSC ★ PPSC

In C++, which type of constructor is called when an object is created without any arguments?

Question 22 of 40
★ FPSC ★ PPSC

What is the primary purpose of the explicit keyword in a C++ constructor?

Question 23 of 40
★ FPSC ★ PPSC

In C++, what is the order of constructor and destructor calls for a class hierarchy?

Question 24 of 40
★ FPSC ★ PPSC

What happens if a constructor throws an exception in C++?

Question 25 of 40
★ FPSC ★ PPSC

In C++, which function cannot be inherited but can be overridden in a derived class?

Question 26 of 40
★ FPSC ★ PPSC

Which of the following statements about constructor initialization lists in C++ is correct?

Question 27 of 40
★ FPSC ★ PPSC

Which of the following statements is true about constructors in C++?

Question 28 of 40
★ FPSC ★ PPSC

What is the purpose of using default arguments in C++ constructors?

Question 29 of 40
★ FPSC ★ PPSC

Which statement about constructor inheritance in C++ is correct?

Question 30 of 40
★ FPSC ★ PPSC

Which statement about destructors in C++ is true?

Question 31 of 40
★ FPSC ★ PPSC

What happens if the destructor is explicitly defined in a C++ class, but the constructor is not defined?

Question 32 of 40
★ FPSC ★ PPSC

What is the purpose of using the delete keyword in C++ destructors?

Question 33 of 40
★ FPSC ★ PPSC

What will be the output of the following C++ code? #include <iostream> #include <string> using namespace std; class A{ mutable int a; public: A(){ cout<<"A's Constructor called\n"; } ~A(){ cout<<"A's Destructor called\n"; } }; class B{ A a; public: B(){ cout<<"B's Constructor called\n"; } ~B(){ cout<<"B's Destructor called\n"; } }; int main(int argc, char const *argv[]) { B b1; }

Question 34 of 40
★ FPSC ★ PPSC

How constructors are different from other member functions of the class?

Question 35 of 40
★ FPSC ★ PPSC

How destructor overloading is done?

Question 36 of 40
★ FPSC ★ PPSC

What will be the output of the following C++ code? #include <iostream> #include <string> using namespace std; class A{ mutable int a; public: A(){ cout<<"Default constructor called\n"; } A(const A& a){ cout<<"Copy Constructor called\n"; } }; int main(int argc, char const *argv[]) { A obj; A a1 = obj; A a2(obj); }

Question 37 of 40
★ FPSC ★ PPSC

When destructors are called?

Question 38 of 40
★ FPSC ★ PPSC

What will be the output of the following C++ code? #include <iostream> #include <string> using namespace std; class A{ mutable int a; public: A(){ cout<<"A's Constructor called\n"; } ~A(){ cout<<"A's Destructor called\n"; } }; class B: public A{ public: B(){ cout<<"B's Constructor called\n"; } ~B(){ cout<<"B's Destructor called\n"; } }; int main(int argc, char const *argv[]) { B b1; }

Question 39 of 40
★ FPSC ★ PPSC

What is the difference between constructors and destructors?

Question 40 of 40
★ FPSC ★ PPSC

What will be the output of the following C++ code? #include <iostream> #include <string> using namespace std; class A{ mutable int a; public: A(){ cout<<"A's Constructor called\n"; } ~A(){ cout<<"A's Destructor called\n"; } }; class B{ static A a; public: B(){ cout<<"B's Constructor called\n"; } ~B(){ cout<<"B's Destructor called\n"; } }; int main(int argc, char const *argv[]) { B b1; }

✓ Link copied to clipboard
Continue Your Practice

Advance Html — Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set →

💡 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.

More Modules in Programming & Software Development

View All →
📚

Study Guides

Topic summaries and syllabus breakdown

Explore Guides →
🎯

Complete Library

Search through 78,000+ verified MCQs

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →