Java Basics  «Prev  Next»

Java Access Control - Quiz

Each question is worth one point.Select the best answer for each question.
 
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

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

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

Score =
Correct answers: