1.

Which among the following for public specifier is false?(a) The static members can’t be public(b) The public members are available in other packages too(c) The subclasses can inherit the public members privately(d) There can be only one public class in java programThe question was posed to me in quiz.I'm obligated to ask this question of Public Access Specifier in section Access Specifiers of Object Oriented Programming

Answer»

The correct CHOICE is (a) The static MEMBERS can’t be PUBLIC

The explanation is: The static members are not property of any object of the CLASS. Instead, those are treated as property of class. This allows US to have public static members too.



Discussion

No Comment Found

Related InterviewSolutions