Assume there is a class Main with a protected variable. Methods in which class can access this variable?
Click to view the answer
B.
The protected modifier allows access by any subclass or class that is in the same package, therefore Option B is the correct answer.