[Joseph]: So, static nested classes can only have package or public visibility? No. This makes me think that a communication error has occurred, and there are two likely sources, which I think should be addressed:
[Rob]: Only inner classes can be protected or private. More correctly: only
nested classes can be protected or private. Nested classes include inner classes and static nested classes; by definition, inner classes are not static. However people often use "inner" and "nested" interchangeably, which can create confusion.
[Joseph]: Hence in many places they are described as basically top-level classes Yes, unfortunately Sun rather stupidly used the term "top-level nested class" to describe static nested classes when they were first introduced to
Java. In 2000 this odious, nonsensical term was removed from the JLS - or more precisely, it was never in the JLS, but a new JLS came out which superseded the badly-named and nonsensical "Inner Classes Specification" which had previously attempted to define nested classes. Since then, officially the term "top-level nested class" has been a logical contradiction (as it should have been all along). Unfortunately many other sources were slow to respond to this change, and you can still find books and people using the old terminology. Please ignore them. All classes are either top-level or nested, but never both. Static nested classes have some things in common with top-level classes, and other things in common with inner classes, but they are neither top-level nor inner. They're in between.