Java: Extend functional interfaces test

This commit is contained in:
Marcono1234
2021-09-12 01:50:07 +02:00
parent edbaceceb3
commit 5009ed618f

View File

@@ -21,9 +21,19 @@ public class Test {
interface FunctionalWithObjectMethods {
int f();
String toString();
// 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();
}
}