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.

4
  • Gaaah, something so simple. Mind explaining why :)? Commented Oct 6, 2012 at 8:10
  • There seems to be a fairly decent explanation here, with links to further info: stackoverflow.com/questions/70324/… Commented Oct 6, 2012 at 8:16
  • @KelseyAbreu: without the static keyword when declaring an inner class - it (the inner class) must have an "attached" instance of the enclosing class. So, you cannot use it (easily) in static methods (such as main(String[])). When using the static keyword, you let the compiler know it does not need an instance of the enclosing class, and is actually behaving like a normal not nested class. Commented Oct 6, 2012 at 8:16
  • Thanks! Some of the most obvious things happen when learning new languages. Commented Oct 6, 2012 at 8:55