Created
November 4, 2019 20:39
-
-
Save juliofalbo/0688a11f21f99314cd706ba2822d1052 to your computer and use it in GitHub Desktop.
Functional Interface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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