I've always been a huge fan of Eckel's
Thinking in Java, but one thing that concerns me is that his use of the terms "inner class" and "nested class" contradict the current
Java Language Specification.
The JLS says:
"A nested class is any class whose declaration occurs within the body of another class or interface." (Ref.)"An inner class is a nested class that is not explicitly or implicitly declared static." (Ref.) Eckel says:
"It's possible to place a class definition within another class definition. This is called an inner class." (Ref.)"...you can make the inner class static. This is commonly called a nested class." (Ref.) In other words, the JLS defines inner classes as a subset of nested classes, but Eckel defines nested classes as a subset of inner classes. I understand that Sun originally used some confusing terminology in this area. But since Sun has cleaned this up, I had hoped that Eckel's 4th edition would parallel the JLS.
(Note: My reference links are to a 3rd edition of TIJ, because that's available online. But the wording of these quotes remains identical in the 4th edition, on pages 345 and 364 respectively.)
[ March 29, 2006: Message edited by: marc weber ]