Packages and Interfaces  «Prev  Next»

Java Packages and Interfaces - Quiz

1. How do you import all of the classes in a package with a single statement?
Please select the best answer.
  A. Provide the package name and the * wildcard
  B. Provide only the package name
  C. Provide the name of any class in the package

2. Which one of the following access modifiers indicates that classes, member variables, and methods are freely accessible?
Please select the best answer.
  A. private
  B. protected
  C. public

3. What is the accessibility of a class modifier if you do not explicitly declare an access modifier?
Please select the best answer.
  A. The public access modifier is assumed
  B. The default access modifier is implicitly used
  C. The access is undefined


4. When a class implements an interface, it is required to provide:
Please select the best answer.
  A. An implementation of each method declared in the interface
  B. An implementation of at least one method declared in the interface
  C. A default constructor