Java Access Control - Quiz Explanation

The correct answers are indicated below, along with text that explains the correct answers.
 
1. To use a class defined in another package, you must first
Please select the best answer.
  A. Make your class a subclass of that class
  B. Import that class
  C. Implement an Interface
  The correct answer is B.
If a class is defined in another package, you must first import that class.
(Then, if you wish, you can make your class a subclass of that class.)

2. To allow access of a member to a subclass, but restrict access to other classes, use the keyword
Please select the best answer.
  A. private
  B. package
  C. protected
  The correct answer is C.
The private keyword restricts access of a member to the class that defines it.
The package keyword indicates the class defined in that file belongs to a particular package.
To restrict access of a member to a subclass, use the keyword protected.


3. To allow a class in one package to be accessed outside that package, use the keyword
Please select the best answer.
  A. public
  B. class
  C. abstract
  The correct answer is A.
The class keyword indicates you are about to define a new class. The abstract keyword indicates the class cannot be instantiated. The correct answer here is public.