1.

What is the type of object that should be specified in the argument list?(a) Function name(b) Object name itself(c) Caller function name(d) Class name of objectThe question was posed to me during an interview for a job.Asked question is from Passing Object to Functions in chapter Assigning Object, Pointer to Objects, Passing and Returning Object of Object Oriented Programming

Answer»

Right choice is (d) CLASS NAME of object

Easy explanation - The type of object is the class itself. The class name have to be specified in order to pass the objects to a FUNCTION. This allows the program to create another object of same class or to USE the same object that was passed.



Discussion

No Comment Found

Related InterviewSolutions