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.