This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
When I read phillip heller's Java Certification Book, It mentioned that a class can't be declared static. but recently one of my colleagues came up with a code showing a class declared as static and still it works fine. is this due to the version difference? what could be the reason? what's the fact? regards, Yogesh
"Thinking of doing something is also doing something ...so don't just stop thinking!"
Inner classes can be static Not by Sun's definition. Nested classes can be static - but if they're static, they're not considered to be inner classes. All classes are either top-level, or nested. If they're nested, they are either static member classes, or they're inner classes. Inner classes are either nonstatic member classes, local classes, or anonymous classes. Older books may use the term "top-level nested class" in place of static member class. This confusing terminology was removed in JLS 2nd edition; it is now best forgotten. Other books may use the term "static inner class". This terminology was never correct according to the official definitions, though some Sun sources gave contradictory info. But Sun has been fairly clear about this for some time now: inner classes are nested classes that are not static. Period. All dissenters will be shot.
"I'm not back." - Bill Harding, Twister
author and iconoclast