100+ MCQ on Constructor and Destructor in C++ - 1
Question: 1
Which of the following is not true?
(A) Copy constructor is invoked when an object is passed by reference to constructor
(B) Copy constructor is invoked when a member function returns an object
(C) Copy constructor is invoked whenever object is created
(D) Copy constructor is invoked when an object is passed as a parameter to a member function
Ans: C
Copy constructor is invoked whenever object is created
Question: 2
Which of the following is automatically executed when the control reaches the end of class scope?
(A) Inline function
(B) Member function
(C) Destructor
(D) Constructor
Ans: C
Destructor
Question: 3
Which of the following is a function that removes the allocated memory of an object?
(A) Copy constructor
(B) Member function
(C) Destructor
(D) Constructor
Ans: C
Destructor
Question: 4
Which of the following is true?
(A) The constructor function can be overloaded
(B) The constructor is executed automatically
(C) A constructor can have parameter list
(D) All the given are true
Ans: D
All the given are true
Question: 5
Which one of the following initializes a class object and allocates memory space?
(A) Member function
(B) Constructor
(C) Destructor
(D) None of the given
Ans: B
Constructor
GATE Chemical Engineering Questions and Answers More
GATE 2024-2025 Question Paper Pdf Download More
Banking Awareness Questions 2024-2025 More
Computer Quiz Questions for Bank Exams More
Computer Quiz Questions for Bank Exams More
Indian Polity and Governance General Knowledge Questions and Answers More
100+ Properties of Matter Questions and Answers Pdf More
1000+ Materials of Construction MCQ Questions and Answers More
1000+ Commonly Misspelled Words Quiz Pdf More
7000+ Multiple Choice Questions on Singular and Plural Nouns More