@@ -0,0 +1,1142 @@
+package com.yxy.chukonu.java.jdk18.feature.inf.dflt.method;%0A%0Apublic class DefaultMethod %7B%0A%09%0A%09interface A%7B%0A%09%09void doSomething();%0A%09%09%0A%09%09default void hello() %7B%0A%09%09%09System.out.println(%22A.hello()%22);%0A%09%09%7D%0A%0A%09%09default void foo() %7B%0A%09%09%09System.out.println(%22A.foo()%22);%0A%09%09%7D%0A%0A%09%7D%0A%09%0A%09// B must be extended from A, otherwise compiling will be failed, because of %0A%09// duplicate methoed hello() and foo() are conflict.%0A%09interface B extends A%7B %0A%09%09default void hello() %7B%0A%09%09%09System.out.println(%22B.hello()%22);%0A%09%09%7D%0A%09%09%0A%09%09default void foo() %7B%0A%09%09%09A.super.hello();%0A%09%09    this.hello();%0A%09%09    A.super.foo();%0A%09%09%7D%0A%09%7D%0A%09%0A%09static class C implements B, A %7B%0A%09  %0A%09%09@Override%0A%09  public void doSomething() %7B%0A%09    System.out.println(%22c.doSomething()%22);%0A%09  %7D%0A%09%09%0A%09%7D%0A%09  %0A%09public static void main(String%5B%5D args) %7B%0A%09%09A instance = new C();%0A%09%09System.out.print(%22instance.hello() =%3E %22); //B.hello()%0A%09%09instance.hello() ;%0A%09%09%0A%09%09System.out.print(%22instance.foo() =%3E %22); //A.hello(); B.hello(); A.foo()%0A%09%09instance.foo();%0A%09%09%0A%09%09System.out.print(%22instance.doSomething() =%3E %22); //c.doSomething()%0A%09%09instance.doSomething();%0A%09%09%0A%09%09System.out.print(%22new C().hello() =%3E %22); //B.hello()%0A%09%09new C().hello();%0A%0A%09%7D%0A%0A%7D%0A

add example for JDK1.8 new feature - interface default method