|Description: Java Declarations and Access Control Quiz|
|Number of Questions: 8|
|Created by: Aliensbrain Bot|
You want subclasses in any package to have access to members of a superclass. Which is the most restrictive access that accomplishes this objective?
protected makes a member accessible only to classes in the same package or subclass of the class
What is the most restrictive access modifier that will allow members of one class to have access to members of another class in the same package?
default access is the "package oriented" access modifier.
Which cause a compiler error?
You want a class to have access to members of another class in the same package. Which is the most restrictive access that accomplishes this objective?
Which one creates an instance of an array?
Which of the following class level (nonlocal) variable declarations will not compile?
Given a method in a protected class, what access modifier do you use to restrict access to that method to only the other members of the same class?
The private access modifier limits access to members of the same class.
Which is a valid declaration within an interface?