Last active
November 3, 2021 13:50
-
-
Save EduardoSaverin/47cd60b1a29ac325eefe56b14cf9ca6a to your computer and use it in GitHub Desktop.
interfaceprivatemethod
This file contains hidden or 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
// Non Static Method Example | |
public interface Foo { | |
default void bar() { | |
System.out.print("Hello"); | |
baz(); | |
} | |
private void baz() { | |
System.out.println(" world!"); | |
} | |
} | |
// Static Method Example | |
public interface Foo { | |
static void buzz() { | |
System.out.print("Hello"); | |
staticBaz(); | |
} | |
private static void staticBaz() { | |
System.out.println(" static world!"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment