Multiple choice technology programming languages

Can a copy constructor accept an object of the same class as parameter, instead of reference of the object?

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

A copy constructor cannot accept an object of the same class by value because doing so would require calling the copy constructor itself to pass the parameter, leading to infinite recursion. Thus, it must accept a reference to the object.