forked from java8/Java8InAction
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMostSpecific.java
More file actions
38 lines (27 loc) · 757 Bytes
/
MostSpecific.java
File metadata and controls
38 lines (27 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package lambdasinaction.chap9;
public class MostSpecific{
public static void main(String... args) {
new C().hello();
new E().hello();
new G().hello();
}
static interface A{
public default void hello() {
System.out.println("Hello from A");
}
}
static interface B extends A{
public default void hello() {
System.out.println("Hello from B");
}
}
static class C implements B, A {}
static class D implements A{}
static class E extends D implements B, A{}
static class F implements B, A {
public void hello() {
System.out.println("Hello from F");
}
}
static class G extends F implements B, A{}
}