--:--









Quiz for Constructors and destructors

Course: C++ Language | Subject: Unit 4 | Topic: Classes and Objects



Logo

Q1: What is the purpose of a constructor in a class?

Logo

Q2: Which of the following is a correct constructor declaration?

Logo

Q3: When is a destructor called?

Logo

Q4: How many destructors can a class have?

Logo

Q5: Which keyword is used to declare a destructor?

Logo

Q6: Can constructors be overloaded?

Logo

Q7: What happens if no constructor is defined in a class?

Logo

Q8: Which of the following is a copy constructor signature?

Logo

Q9: Can destructors take parameters?

Logo

Q10: Which of the following calls the constructor?

Logo

Q11: Is it necessary to explicitly define a destructor?

Logo

Q12: Which of the following statements is true about destructors?

Logo

Q13: What is the order of execution when creating and destroying an object?

Logo

Q14: Can constructors be inherited?

Logo

Q15: What is the effect of declaring a constructor as explicit?

Logo

Q16: Can constructors call other constructors in the same class?

Logo

Q17: Which of the following is NOT a characteristic of constructors?

Logo

Q18: What happens if a destructor throws an exception?

Logo

Q19: How do you declare a constructor for a class named "Car"?

Are you ready to start test? Set your time limit