I love access control in any language, but I find that in Java I almost never (if ever) use the package-private access modifier (or lack thereof).
I realize that inner classes can be private
, protected
, or package-private
, but outer classes can only be package-private
or public
. Why can an outer class be package-private
but not protected
? What is the benefit of restricting classes/methods/fields to be seen by the entire package, but not subclasses?