permaculture playing cards
The moose likes Beginning Java 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 » Beginning Java
Bookmark "static class" Watch "static class" New topic

static class

Prashanth Naidu

Joined: Feb 13, 2004
Posts: 5
Hey all,
I dont understand why you declare a static class in java? I know static means that there is only one copy and every object does not have its own copy of a static method / field. so isn't static mainly used for fields or methods? Why use static for a class. e.g,: public static class myclass {}
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
That is used for inner classes only. It simply means that the inner class can be used without instantiating the outer class.

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
I agree. Here's the link:
subject: static class
It's not a secret anymore!