Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Enthuware - Best Mock Exams and Questions for Oracle Java Certifications
Quality Guaranteed - Pass or Full Refund!
The term "Top Level class" is now kind of deprecated. There is now class, inner class (aka non-static nested class), and static nested class.
It does not matter if the nested class is static or non-static.A nested class is any class whose declaration occurs within the body of another class or interface. A top level class is a class that is not a nested class.
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
"I'm not back." - Bill Harding, Twister
Terminology: Nested classes are divided into two categories: static and non-static. Nested classes that are declared static are simply called static nested classes. Non-static nested classes are called inner classes.
Note: A static nested class interacts with the instance members of its outer class (and other classes) just like any other top-level class. In effect, a static nested class is behaviorally a top-level class that has been nested in another top-level class for packaging convenience.
Enthuware - Best Mock Exams and Questions for Oracle Java Certifications
Quality Guaranteed - Pass or Full Refund!
Originally posted by Jim Yingst:
[b]
A top level class is simply a class that's not nested.
Enthuware - Best Mock Exams and Questions for Oracle Java Certifications
Quality Guaranteed - Pass or Full Refund!
Originally posted by Jim Yingst:
... Yes, Sun did once invent the horrible, evil term "top-level nested class" but they got rid of it long ago...
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Don't get me started about those stupid light bulbs. |