1.

If a class doesn’t have public members, then________(a) None of its members will be able to get inherited(b) None of its instance creation will be allowed(c) None of its member function can be called outside the class(d) None of its data members will be able to get initial valueI had been asked this question at a job interview.My doubt stems from Public Access Specifier in division Access Specifiers of Object Oriented Programming

Answer»

The correct option is (c) None of its member function can be called outside the class

Easiest EXPLANATION - According to RULE of private, protected and default access specifiers, none of the members under these specifiers will be able to get INVOKED outside the class. We are not sure about the members of class SPECIFICALLY so other options doesn’t give a fixed answer.



Discussion

No Comment Found

Related InterviewSolutions