As Sotirios has said, your nested (not-inner) class doesn't implicitly have an instance of Outer
to effectively provide to the Inner
.
You can get round this, however, by explicitly specifying it before the .super
part:
public Nested(String str, Boolean b, Number nm) {
new Outer(10).super("2", true);
}
Or even accept it as a parameter:
public Nested(Outer outer) {
outer.super("2", true);
}
However, I would strongly advise you to avoid such convoluted code. I avoid nested classes most of the time, named inner classes almost always, and I can't ever remember using a combination of them like this.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…