Can a class be declared with a protected modifier.

a) True
b) False

1 thought on “Can a class be declared with a protected modifier.”

  1. b
    Explanation: Protected class member (method or variable) is like package-private (default visibility), except that it also can be accessed from subclasses. Since there is no such concept as ‘subpackage’ or ‘package-inheritance’ in Java, declaring class protected or package-private would be the same thing.

Leave a Comment