hello.
I wanna confirm my understanding on inner class. take the following code for example:
public class Outer{
public
String name = "Outer";
public static void main(String argv[]){
Inner i = new Outer().new Inner();
i.showName();
}//End of main
private class Inner{
String name =new String("Inner");
void showName(){
System.out.println(name);
}
}//End of Inner class
}
----------------
here reference to Inner object i can be declared by its simple name "Inner" (ie. Inner i = ....) because it's defined in the SAME class as the one the class Inner is defined in. is this correct? is this true for both static and non-static inner class?
if I were to declare a reference to a Inner object from ANOTHER class (say class USER) I would have to say" Outer.Inner i =....", is this correct?
please confirm my understanding. your help is much appreciated.
thanks.
chun