Multiple choice

You want a subclass in any package to have access to members of a superclass. Which is the most restrictive access that accomplishes this objective?

  1. public

  2. private

  3. protected

  4. transient

  5. default

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Access modifiers dictate which classes, not which instances, may access features.Methods and variables are collectively known as members. Method and variable members are given access control in exactly the same way.