This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
Originally posted by Sergio Tridente: It compiles fine under java 1.5.
The only problem would come when trying to create an instance of the inner class: you'll need to explicitly use an instance of the outer class.
The following: MyInner m = new MyInner()
- Will work inside a non static method. It is interpreted as: MyInner m = this.new MyInner() - Will not work in a static context.
Yup, that's all true..
It just seemed odd to me that the book said static methods in the same class as the inner class had to use the MyOuter.MyInner syntax, because MyInner should still be in the symbol table (or Javac's equivalent) and hence visible to the static method.
I believe this is an error in the book, and it's not in the "errata" post.