~/ learn/ java-from-zero/ cards/ The diamond problem with default methods
1 of 4

Type an overriding method that delegates to a specific interface default

Type an overriding method that delegates to a specific interface default

Answer

@Override public String greet() { return A.super.greet(); }

Interface.super.method() is the only way to explicitly call a specific interface's default implementation. It is only valid inside the implementing class, not from outside.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/6b691496-30e0-414d-84d2-d9356b283af9/flashcard utf-8 LF