Robin Robin - 1 month ago 6x
Java Question

What is Interface.super

I have recently used default methods in java.
In its implementation I found

public interface DefaultMethod {
default String showMyName(String name){
return "Hai "+name;


public class DefaultMethodMainImpl implements DefaultMethod{

public String showMyName(String name){
return DefaultMethod.super.showMyName(name);


My question is in DefaultMethod.super where super will call it have no super class except Object? what super will return?


If you use super in a class it usually refers to the ancestor of that class (either the extended class or Object).

In the case of overriden default method of an interface you have to specify the specific interface which default implementation you want to invoke, hence


See also The diamond problem.