Skip to content

Instantly share code, notes, and snippets.

@EduardoSaverin
Last active November 3, 2021 13:50
Show Gist options
  • Save EduardoSaverin/47cd60b1a29ac325eefe56b14cf9ca6a to your computer and use it in GitHub Desktop.
Save EduardoSaverin/47cd60b1a29ac325eefe56b14cf9ca6a to your computer and use it in GitHub Desktop.
interfaceprivatemethod
// 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