Saved Bookmarks
| 1. |
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 valuesI got this question during an online exam.Asked question is from Assigning Objects topic in section Assigning Object, Pointer to Objects, Passing and Returning Object of Object Oriented Programming |
|
Answer» CORRECT option is (c) Reference to another OBJECT is created The BEST I can explain: 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. |
|