permaculture playing cards
The moose likes Beginning Java and the fly likes static inner 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 inner class" Watch "static inner class" New topic

static inner class

hari harann
Ranch Hand

Joined: Aug 07, 2008
Posts: 54
when we declare the inner class as static it turns it into a static nested class not an inner class.. is the statement right?? explain me please.. Thanks in advance
Mark Vedder
Ranch Hand

Joined: Dec 17, 2003
Posts: 624

It's a terminology thing. From the Sun Java Tutorial on nested classes:

Terminology: Nested classes are divided into two categories: static and non-static. Nested classes that are declared static are simply called static nested classes. Non-static nested classes are called inner classes.

Take a look at the page for more info. Also see the tutorial page on inner classes. Lastly, you can look at the Java Glossary's page on nested classes
[ August 07, 2008: Message edited by: Mark Vedder ]
I agree. Here's the link:
subject: static inner class
It's not a secret anymore!