posted 19 years ago
Why we cannot declare Base Class to be protected or private?
Just in case the reasons weren't becoming clear...
If an outer class were private, then what use would it be since nobody outside the class could access it? It probably wouldn't be very much use since it wouldn't be usable.
If an outer class is declared with default/package access, then other classes in the same package have access to it, while those outside the package wouldn't have access.
If an outer class is declared with protected access, then who has access to it? Well, other classes in the same package would probably have access, but what about classes in a different package? Another classes outside the package couldn't subclass it since it's not accessible outside the package. So, protected would seem like a meaningless access modification.
At least, that's how I'd guess the language designers considered the issue.