• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Let me get this straight . . .

 
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do they mean by a 'top level' class, and a 'top level nested' class and a 'inner class' and 'non-static inner class' and 'static inner class' and a 'top level static inner class"? ( I made the last one up, but I don't see anything wrong with them.
Also, can a static inner class (meaning this to be an inner class nested to any depth, and assuming that all rules regarding them are the same) have a non-static instance members as well as static instance members?
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check this:
http://www.javaranch.com/ubb/Forum24/HTML/013424.html
Also,
http://developer.java.sun.com/developer/Books/certification/certbook.pdf
And,
Inner class specification
HIH
------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For those interested in a short-n-sweet answer: "Top level static inner" is redundant. If an inner class is static, it's "nested" in one sense (written inside another class), but "top level" in another (doesn't require an instance of the enclosing instance to load).
The other redundant term for this construct is "an abomination" but you should pass your exam first, hurl rocks at the language designers second.
------------------
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide
 
Mathew Kuruvilla
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Michael. That was what I was looking for.
I have also discovered a problem in Khalid's book after going to Valentin's link on the discussion forum here. If you look on page 239, example 7.7,

If we replace the 'static double d' by 'final static double d = 0.0', we find that code does indeed compile is OK.
I do not believe that he mentions this little detail anywhere in the book.
 
We can fix it! We just need some baling wire, some WD-40, a bit of duct tape and this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic