A constructor is called whenever

2023

A constructor is called whenever

Answer: A. an object is createdA constructor is a special member function that is invoked when an object is created. It initializes the newly created object, so the correct option is an…

  1. A.

    an object is created

  2. B.

    a class is created

  3. C.

    a class is declared

  4. D.

    More than one of the above

  5. E.

    None of the above

Attempted by 543 students.

Show answer & explanation

Correct answer: A

A constructor is a special member function that is invoked when an object is created. It initializes the newly created object, so the correct option is an object is created.

Explore the full course: Bpsc

Loading lesson…