I investigate java inner classes.
I wrote example:
public class Outer {
public Outer(int a){}
public class Inner {
public Inner(String str, Boolean b){}
}
public static class Nested extends Inner{
public static void m(){
System.out.println("hello");
}
public Nested(String str, Boolean b , Number nm) { super("2",true); }
}
public class InnerTest extends Nested{
public InnerTest(){ super("str",true,12); }
}
}
I invoke it from main using following string:
new Outer(1).new Inner("",true);
I see compile error:
java: no enclosing instance of type testInheritancefromInner.Outer is in scope
Can you explain me this situation?
UPDATE