Created
October 11, 2019 19:34
-
-
Save juliofalbo/5517db906a7d3b12cbc76048c549e398 to your computer and use it in GitHub Desktop.
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
public class StaticMethods { | |
public static void main(String[] args) { | |
InterfaceWithStaticMethod impl1 = (text) -> System.out.println("Custom Message " + text); | |
impl1.printWithCustomMessage("Text"); | |
InterfaceWithStaticMethod.print("Text"); | |
} | |
} | |
interface InterfaceWithStaticMethod { | |
void printWithCustomMessage(String text); | |
static void print(String text) { | |
System.out.println(text); | |
} | |
} | |
interface RunnableInterface { | |
public static void main(String[] args) { | |
System.out.println("Ran by an Interface"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment