Question 136

In C++, a copy constructor is called when:

  1. AA static member is accessed
  2. BAn object is initialised from another object of the same class
  3. CAn object goes out of scope
  4. DA pointer is deleted
Show answerHide answer

Correct answer: (B) An object is initialised from another object of the same class

Explanation

Example: Student s2 = s1;

From DSSSB TGT Computer Science Full Mock Test 5

This is question 136 of DSSSB TGT Computer Science Full Mock Test 5. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.