case I
class Outer {
void outerMethod() {
Inner i = new Inner(); //compile error : cannot find symbol
i.innerMethod();
class Inner {
void innerMethod() {
System.out.println("inner class method...");
}
}
}
}
case II
class Outer {
void outerMethod() {
Inner i = new Inner();
i.innerMethod();
}
class Inner {
void innerMethod() {
System.out.println("inner class method...");
}
}
}
there are two separate class files in these two cases. but one is getting compile error and other one is fine. what is the reason for that ?