Multiple choice technology programming languages

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?

  1. default access

  2. public

  3. private

  4. protected

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

Default (package-private) access is the most restrictive that allows classes in the same package to access members. Public allows access from anywhere, private restricts access to the same class only, and protected allows access to subclasses (even in different packages).