Can a class be declared with a protected modifier.
Can a class be declared with a protected modifier. Correct Answer False
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.
মোঃ আরিফুল ইসলাম
Feb 20, 2025