Constructors and Destructors Interview Questions

    Question 1C++ OOPS - Constructor Naming

    What is the correct naming rule for a constructor in C++?

    Question 2C++ OOPS - Default Constructor

    Which of the following correctly defines a default constructor?

    Question 3C++ OOPS - Parameterized Constructor

    If `class Box` has a constructor `Box(int h, int w)`, how do we correctly create an object?

    Question 4C++ OOPS - Constructor Overloading

    What does constructor overloading in C++ mean?

    Question 5C++ OOPS - Copy Constructor

    Which of the following correctly declares a copy constructor for class `Student`?

    Question 6C++ OOPS - Implicit Copy Constructor

    When does the compiler provide a default copy constructor?

    Question 7C++ OOPS - Destructor Characteristics

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

    Question 8C++ OOPS - Destructor Naming

    Which is the correct way to define a destructor for class `Car`?

    Question 9C++ OOPS - Order of Execution

    What is the order of execution for constructors and destructors in nested objects?

    Question 10C++ OOPS - Destructor Call

    When is a destructor called for an automatic (stack) object?