jQuery in Action, 3rd edition
The moose likes Beginning Java and the fly likes class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "class" Watch "class" New topic


anish reddy
Ranch Hand

Joined: Apr 19, 2008
Posts: 74
why outer class cant be declared as static,when we can declare inner class as static. Even though i read in book that outer class cant be declared static, i am unable to understand the exact reason so can any one explain in brief description,

so please can anyone help in this matter.

waiting for yours reply

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 45251
Static means that something belongs to the class it is inside, as opposed to individual instances of that class. So a top-leve class doesn't have a surrounding class to belong to, so it can't be static. That help?

And welcome to the Ranch
I agree. Here's the link: http://aspose.com/file-tools
subject: class
It's not a secret anymore!