-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinterfaces2.html
More file actions
41 lines (36 loc) · 856 Bytes
/
interfaces2.html
File metadata and controls
41 lines (36 loc) · 856 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
38
39
40
41
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://javaalmanac.io/almanac.min.css">
</head>
<body>
<div class="content" id="content">
<sandbox version="java17" mainclass="Main" preview="true" v-cloak>
<sandbox-source name="Main.java">
interface X {
default String message() {
return "Hallo X";
}
}
interface Y {
default String message() {
return "Hallo Y";
}
}
class XY implements X, Y {
public String message() {
return X.super.message();
}
}
public class Main {
public static void main(String[] args) {
XY xy = new XY();
System.out.println(xy.message());
}
}</sandbox-source>
</sandbox>
</div>
<script src="https://javaalmanac.io/app/sandbox-bundle.js"></script>
<script>new Vue({ el: '#content' })</script>
</body>
</html>