1.

Which is not a proper way to access public members of a class?(a) Using object pointer with arrow operator(b) Using object of class in main function(c) Using object of class with arrow operator(d) Using object anywhere in the programThe question was asked by my college professor while I was bunking the class.This intriguing question comes from Public Member Functions in division Member Functions & its Types of Object Oriented Programming

Answer»

Right choice is (C) USING object of class with arrow operator

For explanation: The public members can be accessed ANYWHERE in the program using the object of the class. And if object pointer is USED, then arrow operator is used to access class members. If NORMAL object is used with arrow operator, an error will be generated.



Discussion

No Comment Found

Related InterviewSolutions