If an object is created and another object is assigned to it, then ________________

Bờm

Member
If an object is created and another object is assigned to it, then ________________
A. Copy constructor is called to copy the values
B. Object is copied directly to the object
C. Reference to another object is created
D. The new object is initialized to null values
 
Answer: c
Explanation: The new object created, refers to the same address of the previously created object. Now whenever new object changes any data member value, it will affect the previously existing object.
 

Tìm kiếm

Back
Top