Accessing overridden default methods from implementing class

suggest change

In classes, will look in superclasses only. If you want to call a default implementation from a superinterface, you need to qualify super with the interface name:

public interface Fooable {
    default int foo() {return 3;}

public class A extends Object implements Fooable {
    public int foo() {
        //return + 1; //error: no method foo() in java.lang.Object
        return + 1; //okay, returns 4

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents