Originally posted by waseem nadaf:
So if the class itself is declared as protected then the class cant be extended outside the package as the class is not at all visible outside the package.
Class cannot be protected , it can only be public or default.
And if the JLS had something like to have a class protected then it would have been very much possible for the classes outside the same package to extend the protected class.