Constructors and Destructors – MCQs July 22, 2025 by u930973931_answers 30 Score: 0 Attempted: 0/30 Subscribe 1. : What is a constructor in C++? (A) A function to destroy objects (B) A special function to initialize objects (C) A function that runs the program (D) A function that frees memory 2. : What is the name of a constructor in a class? (A) init() (B) start() (C) Same as class name (D) object() 3. : What is a destructor in C++? (A) A function to create an object (B) A function to delete a class (C) A special function to clean up resources (D) A function to compile the program 4. : Which symbol is used to define a destructor? (A) ~ (tilde) (B) ! (exclamation) (C) # (hash) (D) $ (dollar) 5. : How many destructors can a class have in C++? (A) One (B) Two (C) Unlimited (D) None 6. : Can a constructor be virtual in C++? (A) Yes (B) No (C) Only in abstract classes (D) Only static 7. : Which of the following is true about a destructor? (A) It has parameters (B) It returns a value (C) It is automatically called when an object is destroyed (D) It is called manually 8. : Which of the following is a type of constructor? (A) Default (B) Copy (C) Parameterized (D) All of the above 9. : What is a default constructor? (A) Constructor with arguments (B) Constructor with no arguments (C) Destructor (D) Static function 10. : When is a constructor executed? (A) During compilation (B) Before main() (C) When an object is created (D) When class is declared 11. : Can constructors be overloaded? (A) Yes (B) No (C) Only if static (D) Only one constructor allowed 12. : What is the return type of a constructor? (A) int (B) void (C) class (D) No return type 13. : What happens if you don’t define a constructor? (A) Error occurs (B) Object cannot be created (C) Compiler provides a default constructor (D) Class becomes static 14. : What is a parameterized constructor? (A) Constructor with no parameters (B) Constructor that destroys object (C) Constructor that takes arguments (D) Constructor called automatically 15. : Can destructors be overloaded? (A) Yes (B) No (C) Only with friend function (D) Only once 16. : What is the purpose of a copy constructor? (A) Delete an object (B) Copy data from one object to another (C) Create new object only (D) Compile the class 17. : What is the syntax of a destructor for class Sample? (A) void ~Sample() (B) Sample() (C) ~Sample() (D) destructor Sample() 18. : Can a destructor have parameters? (A) Yes (B) No (C) Only one (D) Only if private 19. : What does a copy constructor accept as a parameter? (A) An object by value (B) An object by reference (C) A class name (D) A string 20. : How many times is a destructor called for a single object? (A) Once (B) Twice (C) As many as required (D) Zero 21. : Which of the following statements is true about constructors? (A) They can be called manually (B) They can return values (C) They must be public (D) They can initialize data members 22. : When is a destructor called in C++? (A) When a class is created (B) When an object goes out of scope (C) During compilation (D) At the beginning of the program 23. : What is the primary use of a destructor? (A) Initialize variables (B) Overload functions (C) Release resources (D) Define class 24. : What type of function is a constructor? (A) Static function (B) Member function (C) Global function (D) Friend function 25. : Which constructor is used when a new object is created from an existing object? (A) Default constructor (B) Parameterized constructor (C) Copy constructor (D) None of these 26. : Can a constructor call another constructor in the same class? (A) Yes, using this() (B) No (C) Only in destructors (D) Only in C language 27. : Which of the following can be virtual in C++? (A) Constructor (B) Destructor (C) Main function (D) Static function 28. : Which of the following calls a copy constructor? (A) Passing an object by value (B) Returning an object by value (C) Creating a new object using another (D) All of the above 29. : Which constructor is called if no arguments are passed during object creation? (A) Default constructor (B) Parameterized constructor (C) Copy constructor (D) Friend constructor 30. : What is the function of a constructor with default arguments? (A) Prevent constructor overloading (B) Act as both default and parameterized constructor (C) Call the destructor (D) Declare static objects