-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathTest.java
More file actions
39 lines (29 loc) · 794 Bytes
/
Test.java
File metadata and controls
39 lines (29 loc) · 794 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
public class Test {
interface Functional {
int f();
}
class Concrete implements Functional {
public int f() { return 0; }
}
interface FunctionalWithDefaults {
int f();
default int g() { return 1; }
}
interface NotFunctional {
default int g() { return 1; }
}
interface FunctionalWithObjectMethods {
int f();
// Not actually abstract; implementation comes from Object
boolean equals(Object obj);
int hashCode();
String toString();
}
interface NotFunctionalWithObjectMethods {
int f();
// Increases their visibility from `protected` to `public`; this requires subclasses to implement them
// See also JLS section "Functional Interfaces" which explicitly covers this
Object clone();
void finalize();
}
}