Skip to content

Instantly share code, notes, and snippets.

@bloodredsun
Last active August 29, 2015 14:05
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save bloodredsun/31af3f3e8bf56dda6566 to your computer and use it in GitHub Desktop.
Java default method example
package com.brs;
public class JavaDefaultMethodsExample {
public static void main(String[] args) {
MyJavaExample myJavaExample = new MyJavaExample();
myJavaExample.writeOut();
}
}
class MyJavaExample implements InterfaceOne {
}
interface InterfaceOne {
default void writeOut() {
System.out.println("In InterfaceOne");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment