Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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