Java theorytheory 0/50 · 0%
OOP · easy

5. Access Modifiers

Controlling visibility of members.

Java provides public, protected, private, and default (package-private) modifiers to control access to classes, methods, and variables.

Check your understanding

  1. 1. Visible only within the class?

  2. 2. Visible to subclasses in other packages?