1.

Whenever an object is returned by value ____________________(a) A temporary object is created(b) Temporary object is not created(c) Temporary object may or may not be created(d) New permanent object is createdThis question was addressed to me in class test.My question is taken from Returning Objects in division Assigning Object, Pointer to Objects, Passing and Returning Object of Object Oriented Programming

Answer»

Correct answer is (a) A temporary object is CREATED

The best explanation: A temporary object is created when an object is RETURNED by value. The temporary object is USED to copy the values to another object or to be used in some way. The object holds all the values of the data members of the object.



Discussion

No Comment Found

Related InterviewSolutions