This seems to be a very simple and straight forward,but i want a logic for the fact that why are protected classes not allowed while default classes are allowed as top level classes,even though protected is less restrictive as compared to default?
default: If you do not set access to specific level, then such a class, method, or field will be accessible from inside the same package to which the class, method, or field belongs, but not from outside this package. This access-level is convenient if you are creating packages.
protected: Fields, methods and constructors declared protected in a superclass can be accessed only by subclasses in other packages. Classes in the same package can also access protected fields, methods and constructors as well, even if they are not a subclass of the protected member’s class.
This may help you.
Oracle Certified Professional, Java SE 6 Programmer.
Classes in different packages cannot access classes that are protected. so it is meaningless to have the top level class protected. we already have default access to provide access for classes within same package