Multiple choice

What is the default scope of a method in Java?

  1. Private

  2. Public

  3. Protected

  4. Package-private

  5. None of these

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

The default scope is package-private. All classes in the same package can access the method/field/class. Package-private is stricter than protected and public scopes, but more permissive than private scope.