In short, Top-Level classes are:
1.The ones that are not defined within any class, and
2.The ones that are modified with the keyword "static" and defined within other Top-Level Classes (In this case, they are called nested classes)
In this context, I've to mention that some people tend to associate Top-Level classes with inner classes. But Khalid Mughal is very articulate on this topic. This is what he's got to say...
In the realm of nested classes are the following:
- Top-Level Nested Classes and Interfaces
- Non-Static Inner Classes
- Local Classes
- Anonymous Classes
Of these, the Top-Level Nested Classes and Interfaces are said to be at the top level. The last three are collectively known as inner classes.
Hope this helps
Shyam