Created
October 25, 2015 14:33
-
-
Save anjanashankar9/72ba7e3be9ccb8a62601 to your computer and use it in GitHub Desktop.
Interfaces in Java8
This file contains 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
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