1.

If the members have to be accessed from anywhere in the program and other packages also, which access specifier should be used?(a) Public(b) Private(c) Protected(d) DefaultI had been asked this question in an interview for job.Question is from Public Access Specifier in portion Access Specifiers of Object Oriented Programming

Answer»

The correct choice is (a) Public

Easiest explanation - The access SPECIFIER MUST be public so as to access the members outside the class and anywhere WITHIN the program without USING inheritance. This is a RULE, predefined for the public members.



Discussion

No Comment Found

Related InterviewSolutions