Solutions to selected exercises can be found in the electronic document The Thinking in Java Annotated Solution Guide, available for a small fee from www.BruceEckel.com.
Prove that the fields in an interface are implicitly static
and final.
[33] This approach was inspired by an e-mail from Rich Hoffarth. Item 21 in Joshua Blochs Effective Java (Addison-Wesley, 2001) covers the topic in much more detail.
[34] Thanks to Martin Danner for asking this question during a seminar.
[35] This is very different from the design of nested classes in C++, which is simply a name-hiding mechanism. There is no link to an enclosing object and no implied permissions in C++.
[36] Roughly similar to nested classes in C++, except that those classes cannot access private members as they can in Java.
[38] On the other hand, $ is a meta-character to the Unix shell and so youll sometimes have trouble when listing the .class files. This is a bit strange coming from Sun, a Unix-based company. My guess is that they werent considering this issue, but instead thought youd naturally focus on the source-code files.
[39] For some reason this has always been a pleasing problem for me to solve; it came from my earlier book C++ Inside & Out, but Java allows a much more elegant solution.