1.

When an object is returned___________(a) A temporary object is created to return the value(b) The same object used in function is used to return the value(c) The Object can be returned without creation of temporary object(d) Object are returned implicitly, we can’t say how it happens inside programThe question was asked in semester exam.I'm obligated to ask this question of Objects topic in chapter OOPs Concept & Features of Object Oriented Programming

Answer»

Correct choice is (a) A TEMPORARY object is CREATED to return the value

The explanation: A temporary object is created to return the value. It is created because the object used in function is destroyed as SOON as the function is returned. The temporary variable returns the value and then gets destroyed.



Discussion

No Comment Found

Related InterviewSolutions