1.

What exactly is passed when an object is passed by reference?(a) The original object name(b) The original object class name(c) The exact address of the object in memory(d) The exact address of data membersI have been asked this question in an internship interview.I need to ask this question from Passing Object to Functions in division Assigning Object, Pointer to Objects, Passing and Returning Object of Object Oriented Programming

Answer»

Right choice is (c) The exact address of the object in memory

Explanation: The LOCATION of the object, that is, the exact memory location is PASSED, when the object is passed by REFERENCE. The pass by reference is ACTUALLY a reference to the object that the function uses with another name to the same memory location as the original object uses.



Discussion

No Comment Found

Related InterviewSolutions