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 must accept a reference to an object of the same class, not the object itself. If it accepted an object by value, it would need to call the copy constructor to make the copy, creating infinite recursion. Therefore, copy constructors always take a reference parameter.