While I might have misinterpreted the statement, it's certainly true that static inner classes may have static members:
Vishwanath Krishnamurthi
Ranch Hand
Joined: Jun 04, 2007
Posts: 300
posted
Hi,
Its a common misconception. A static class that is nested in a class is called as "static nested class" and not as static inner class. That was the confusion I guess?
Terminolgy:
inner class => any non static nested class
Sun tutorial
Regards,
Vishwa
This message was edited 1 time. Last update was at by Vishwanath Murthi
Marcel Stör
Greenhorn
Joined: Apr 26, 2009
Posts: 3
posted
Was I ignorant all those many years that I've been programming Java? I really wasn't aware of the difference in terminology...
Thanks for the link, but IMO in that article even Sun makes a mess out of those terms. At the end they quite correctly admit that
...the taxonomy of the different kinds of classes in the Java programming language (which can be tricky to describe concisely, clearly, and correctly),...
Today is a good day - I learned something
Regards,
Marcel
Krishna Srinivasan
Ranch Hand
Joined: Jul 28, 2003
Posts: 1778
posted
Yes..static inner classes called as the nested classes..the following program will not work. because it declares static field inside a inner class.
Since your confusion is already clear please do remember that the modifier static always means that it belongs to class and is treated as member. That is why static inner class is called a member class and not inner. So if you do hear inner classes it will mostly refer to non static inner class and local inner classes.
Obstacles are the things we see when we take our eyes off our goals.