aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/test5/DefaultMethod.java
blob: 7cabb1f33f2956da14b438a758e8795110285cf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package test5;

interface DefaultMethodSupIntf {
    default int foo() { return 0; }
}

interface DefaultMethodIntf extends DefaultMethodSupIntf {
    default int foo() { return 1; }
    static int baz() { return 10; }
}

public class DefaultMethod implements DefaultMethodIntf {
    public int bar() { return DefaultMethodIntf.super.foo(); }

    public static void main(String[] args) {
        int i = new DefaultMethod().bar() + new DefaultMethod().foo() + DefaultMethodIntf.baz();
        System.out.println(i);
    }
}