1.

All the public member functions ___________________(a) Can’t access the private members of a class(b) Can’t access the protected members of a class(c) Can access only public members of a class(d) Can access all the member of its classThis question was posed to me in an international level competition.My enquiry is from Public Member Functions in section Member Functions & its Types of Object Oriented Programming

Answer»

Right choice is (d) Can access all the member of its class

The EXPLANATION is: The PUBLIC member function can access any PRIVATE, protected and public member of its class. Not only public member function, any member function of a class can access each and EVERY other member DECLARED inside the class. Hence are flexible to program.



Discussion

No Comment Found

Related InterviewSolutions