Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Top level Class

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Need what is meant by Top level class.
Example Static Inner Class ? How are they top level classes. Main Difference between Top level Class as a result of static modifier and Normal Top Level Class.
 
Amar Srivastava
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well Static inner classes are not top level classes, they are technically speaking called "top-level nested classes" which differentiates them from just plain top-level classes. Top level classes on the other hand are public/default classes that are held in .java files and are not enclosed in any other classes
[This message has been edited by Amar Srivastava (edited July 25, 2000).]
 
ricky gonzalez
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Top level classes are the independent, free classes that can be either public or default. Static inner classes are considered top level because they are really independent from the enclosing class and can be called at anytime separately from its outer classes.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
Top level classes can be defined as classes that are
1)static class members and
2)classes which are package members
Thus nested classes(static class members) are indeed Top Level classes.
for futher info on inner classes visit http://java.sun.com/products/jdk/1.1/docs/guide/innerclasses/spec/innerclasses.doc1.ht ml
regds.
Rahul

[This message has been edited by rahul_mkar (edited July 26, 2000).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic