Skip to content

Instantly share code, notes, and snippets.

@anjanashankar9
Created October 25, 2015 14:33
Show Gist options
  • Save anjanashankar9/72ba7e3be9ccb8a62601 to your computer and use it in GitHub Desktop.
Save anjanashankar9/72ba7e3be9ccb8a62601 to your computer and use it in GitHub Desktop.
Interfaces in Java8
public class MyInterfaceImpl implements MyInterface {
@Override public void method1() {
System.out.println("Implementation of method 1");
}
@Override public void method2() {
System.out.println("Implementation of method 2");
}
public static void main(String[] args){
MyInterface obj = new MyInterfaceImpl();
obj.method1();
obj.method2();
obj.newMethod();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment