Merge pull request #6672 from Marcono1234/marcono1234/functional-interfaces-test

Java: Extend functional interfaces test
This commit is contained in:
Anders Schack-Mulligen
2021-09-13 11:13:06 +02:00
committed by GitHub

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();
}
}