• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help on explanation on Top level class

 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I need some definition or explanation on Top-Level class.
In RHE pg 186 on Objects and Classes, it mentioned that "The net result is that a static inner class is really a top-level class with a modified naming scheme"
Can someone explain a little on this for me especially on what is a Top-Level class.
Thanks.

Han Ming
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In short, Top-Level classes are:
1.The ones that are not defined within any class, and
2.The ones that are modified with the keyword "static" and defined within other Top-Level Classes (In this case, they are called nested classes)
In this context, I've to mention that some people tend to associate Top-Level classes with inner classes. But Khalid Mughal is very articulate on this topic. This is what he's got to say...
In the realm of nested classes are the following:

  • Top-Level Nested Classes and Interfaces
  • Non-Static Inner Classes
  • Local Classes
  • Anonymous Classes

  • Of these, the Top-Level Nested Classes and Interfaces are said to be at the top level. The last three are collectively known as inner classes.
    Hope this helps
    Shyam
 
HanMing Low
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Shyamsundar,
Thanks for the explanation.
I have a better understanding of the term now.
However, I think I'd need more practice to perfect it.

Thanks again.
Cheers.

Han Ming
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes! Absolutely...that's the surest way to understand stuff...
Lotsa luck
Shyam
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic