1.

Pass by reference of an object to a function _______________(a) Affects the object in called function only(b) Affects the object in prototype only(c) Affects the object in caller function(d) Affects the object only if mentioned with & symbol with every callI had been asked this question by my college director while I was bunking the class.My question is based upon Passing Object to Functions topic in section Assigning Object, Pointer to Objects, Passing and Returning Object of Object Oriented Programming

Answer»

The CORRECT choice is (c) Affects the object in CALLER FUNCTION

To explain: The original object in the caller function will get AFFECTED. The changes made in the called function will be same in the caller function object also.



Discussion

No Comment Found

Related InterviewSolutions