Skip to content

Instantly share code, notes, and snippets.

@juliofalbo
Created November 4, 2019 20:39
Show Gist options
  • Save juliofalbo/0688a11f21f99314cd706ba2822d1052 to your computer and use it in GitHub Desktop.
Save juliofalbo/0688a11f21f99314cd706ba2822d1052 to your computer and use it in GitHub Desktop.
Functional Interface
@FunctionalInterface
public interface FunctionalI {
void abstractMethod();
default String defaultMethod() {
return "defaultMethod";
}
static String staticMethod() {
return "staticMethod";
}
boolean equals(Object obj);
}
class Main {
public static void main(String[] args) {
FunctionalI a = () -> System.out.println("test");
a.abstractMethod();
System.out.println(a.defaultMethod());
System.out.println(FunctionalI.staticMethod());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment