Which of the following statements with reference to constructor and destructor…

PYQ DSSSB 2022

Which of the following statements with reference to constructor and destructor in C++ is FALSE?

  1. A.

    The destructor can have parameters, but the constructor does not receive any parameters.

  2. B.

    A constructor is called by the compiler whenever the object of the class is created.

  3. C.

    A destructor is called by the compiler when the object is destroyed.

  4. D.

    Both constructor and destructor can be defined as public, private, or protected.

Attempted by 621 students.

Sign up free to check your answer

Sign up free

Explore the full course: Dsssb Tgt Computer Science Paper 2

Loading lesson…