I know that you can use super.super.methodName()
to invoke the grandparent's version of a method, but is there any way to directly invoke the grandparent class's constructor in a chained constructor call?
(Simplified) Example:
class A {
public A(){}
public A(int i, boolean b) {
/*...*/
}
}
class B extends A {
public B(){}
public B(int i) {
super(i, true);
}
}
class C extends B {
public C(int i)
{
super.super(i,false); //This is not allowed, but you
//can see what I'm trying to do (call A(i,false).)
//this=new A(i,false); also doesn't work b/c this can't be LHS
//of assignment
}
}
..or is this disallowed, and did I just demonstrate the reasoning for doing so in attempting to make a super.superclass(grandparent) constructor call not possible in the (parent)superclass?