I give you an example to set some context here, so I have two interfaces each inheriting the same parent interface and defining their own implementation of the parent interface's abstract method.
interface A
{
Set a();
}
interface B extends A
{
@Override
default Set a()
{
return null;
}
}
interface C extends A
{
@Override
default Set a()
{
return null;
}
}
In an interface called D
, The implementation creates an anonymous inner class which then needs to call the super types (B
and C
) a()
implementation.
interface D extends B, C
{
@Override
default Set a()
{
return new HashSet()
{
{
final int totalSize = D.this.B.super.a().size() + D.this.C.super.a().size();
}
};
}
}
The problem is that the expressions D.this.B.super.a()
and D.this.C.super.a()
do not get compiled successfully, so what is up ?
Thank you by the way for your efforts.