Say I have two classes, A
and B
:
class A
{
void method()
{
System.out.println("a.method");
}
}
class B extends A
{
@Override
void method()
{
System.out.println("b.method");
}
}
After instantiating B
as b
, I can call B
's method like b.method()
. I can also make B
's method call A
's method with super.method()
. But what if A
is an interface:
interface A
{
default void method()
{
System.out.println("a.method");
}
}
class B implements A
{
@Override
void method()
{
System.out.println("b.method");
}
}
Is there any way I can make B
's method call A
's method?