Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • Read the spec: "An inner class is a nested class that is not explicitly or implicitly declared static.", and "A nested class is any class whose declaration occurs within the body of another class or interface.". They're not inside the body of another class, so they're not inner classes. Commented Sep 12, 2016 at 12:09
  • It's always easy to read something if one know's what to look for. ;-) Thanks for the link. Commented Sep 12, 2016 at 12:15
  • Before there was inner classes there was package local classes. This was available from Java 1.0. Commented Sep 12, 2016 at 12:23
  • @PeterLawrey I'm aware of the (non-) modifier for "package private" classes. What I was not aware of, is the possibility to declare more than one class in a single class-file. Commented Sep 12, 2016 at 12:27
  • The only limitation is at most one top level public class. Commented Sep 12, 2016 at 12:40