Declaration And Access Control - Study Mode
[#1] What is the default access modifier for class members in Java if no access modifier is specified?
Correct Answer
(D) package-private
[#2] Which access modifier restricts a class member's visibility only to the same class and its subclasses?
Correct Answer
(C) protected
[#3] What keyword is used to declare a constant in Java, which is implicitly final and static?
Correct Answer
(A) final
[#4] Which of the following access modifiers allows access to a class member from any class in any package?
Correct Answer
(C) public
[#5] What is the access level of a class member with no access modifier specified in Java?
Correct Answer
(D) package-private