Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public interface InterfaceExampleV8 {
- public static String STATICVARIABLE = "A static variable";
- default void aDefaultMethod(String name) {
- Utility.p("This is a default method in an interface:" + name);
- }
- static void aStaticMethod(String name) {
- Utility.p("This is a static method in an interface:" + name);
- }
- public void anAbstractMethod(String name);
- public static void main(String[] args) {
- System.out.println("calling a main method in an Interface!");
- aStaticMethod("what!!!");
- InterfaceExampleV8 v8 = new InterfaceExampleV8(){
- @Override
- public void anAbstractMethod(String name) {
- System.out.println("calling the abstract method inside the interface:" + name);
- aDefaultMethod("Now This cannot Be!:" + name);
- }
- };
- System.out.println("calling interface methods");
- v8.aDefaultMethod("Help!!!");
- v8.anAbstractMethod("Help even more!!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement