aspose file tools*
The moose likes Java in General and the fly likes Static Class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Static Class" Watch "Static Class" New topic
Author

Static Class

Tan Richards
Greenhorn

Joined: Sep 29, 2005
Posts: 18
Hi,
Can anyone plz tell me why top level static classes are not allowed in Java?


"Failures are pillars of success" - That doesn't mean you go on building pillars
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24185
    
  34

What would be the difference between a top-level static class and a top-level non-static class? Or in other words, what would you expect "static" to mean for a top-level class?


[Jess in Action][AskingGoodQuestions]
Aadi Narayana Reddy
Greenhorn

Joined: Oct 17, 2005
Posts: 13
The top level class never be static. IT is language defined.
Class is intended to create objects to make useful. Static things not belong to any object. They have defined like that.

But static inner classes exists, means that that class object can be accessed with out having the object of the top level class.


G.Adi Narayana Reddy,
 
 
subject: Static Class