
Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Could you clarify a bit the reason(if there is) why you didn't try to cover all static data, static methods, static blocks and static classes into chapter-6, which is titiled as Static, Final and Enumeration Types?
Author of <a href="http://www.amazon.com/exec/obidos/ASIN/0131482114/ref=jranch-20" target="_blank" rel="nofollow">Just Java(TM) 2 (6th Edition)</a>

Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Originally posted by Siripa Siangklom:
Please see this thread

Originally posted by Gregg Bolinger:
Thanks Siripa. Man, I have read about static and I knew what it was and what is was used for, but never have I read such a simple plain powerful description of it like what is in chapter 6. Well done Peter!![]()
A common pitfall with static methods
A common pitfall is to reference per-object members from a static method. This
�does not compute�. A static method isn�t invoked on an object and doesn�t have
the implicit �this� pointer to individual object data, so the compiler won�t know
which object you want. You�ll get an error message saying �Can't make static
reference to non-static variable.�
But the chapter reminds me again of such error... That's cool...This section looks at final, which makes something constant. Why was the word
�const� or �constant� not chosen? Because �final� can also be applied to methods,
as well as data, and the term �final� makes better sense for both.

Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
| With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |