Multiple choice technology programming languages

If a method is declared as protected, where may the method be accessed?

  1. Interfaces of the same package and other packages

  2. Classes of the same package

  3. Classes of the same package and other packages

  4. Interfaces of the same package

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

Protected members are accessible within the same package (to both classes and interfaces) and to subclasses in other packages via inheritance. Option C is wrong because it suggests same-class access isn't required.