blob: 25e3feae88ede7f6689aa40bf2743a95239fc623 [file] [log] [blame]
Mads Ager418d1ca2017-05-22 09:35:49 +02001// Copyright (c) 2017, the R8 project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5package interfacemethods;
6
Mikaël Peltier1f1b7552017-06-02 13:48:06 +02007import interfacemethods.p1.I4;
8
Mads Ager418d1ca2017-05-22 09:35:49 +02009public class DefaultMethods {
10
Mikaël Peltiereb1d5882017-05-23 15:08:41 +020011 interface I3 {
12 default int getValue() {
13 return 1;
14 }
15
16 }
17
18 static class C3 {
19 public int getValue() {
20 return 2;
21 }
22 }
23
24 static class C4 extends C3 implements I3 {
25 }
26
Mikaël Peltier1f1b7552017-06-02 13:48:06 +020027 static class C5 implements I4 {
28 }
29
Mads Ager418d1ca2017-05-22 09:35:49 +020030 public static void main(String[] args) {
31 new C2().d1();
Mikaël Peltiereb1d5882017-05-23 15:08:41 +020032 System.out.println(new C4().getValue());
Mikaël Peltier1f1b7552017-06-02 13:48:06 +020033 new C5().dump();
Mads Ager418d1ca2017-05-22 09:35:49 +020034 }
35}