Raj<br />Sun Certified Java Programmer
Raj<br />Sun Certified Java Programmer
in the main method like this Inner in = new Outer.Inner(); because the main method is also static.
Aymen Esawey<br />SCJP <img src="smile.gif" border="0"> <br /><a href="http://www.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=32&t=001968" target="_blank">how to nuke the SUN </a>
A nested class is any class whose declaration occurs within the body of another class or interface. A top level class is a class that is not a nested class.
...
Member class declarations (�8.5) describe nested classes that are members of the surrounding class. Member classes may be static, in which case they have no access to the instance variables of the surrounding class; or they may be inner classes (�8.1.2).
...
A member class is a class whose declaration is directly enclosed in another class or interface declaration.
...
If a member class or interface declared with simple name C is directly enclosed within the declaration of a class with fully qualified name N, then the member class or interface has the fully qualified name N.C.
The static keyword may modify the declaration of a member type C within the body of a non-inner class T. Its effect is to declare that C is not an inner class. Just as a static method of T has no current instance of T in its body, C also has no current instance of T, nor does it have any lexically enclosing instances.
...
It is a compile-time error if a static class contains a usage of a non-static member of an enclosing class.
Member interfaces are always implicitly static. It is permitted but not required for the declaration of a member interface to explicitly list the static modifier.
Hoo hoo hoo! Looks like we got a live one! Here, wave this tiny ad at it:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|