1.

If object is passed by reference ____________________(a) Temporary object is created(b) Temporary object is created inside the function(c) Temporary object is created for few seconds(d) Temporary object is not createdThis question was addressed to me in an international level competition.My query is from Returning Objects in portion Assigning Object, Pointer to Objects, Passing and Returning Object of Object Oriented Programming

Answer»

Correct answer is (d) Temporary object is not created

The BEST I can explain: The temporary object is not created. If object is returned by reference, a PARTICULAR MEMORY location will be DENOTED with another name and hence same address values will be used.



Discussion

No Comment Found

Related InterviewSolutions