Click here to watch in Youtube :
https://www.youtube.com/watch?v=09bnFmTjZ9w&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
Java Tutorial : Java default method in super interface |
public interface InterfaceA { default public void sayWelcome() { System.out.println("Welcome by InterfaceA"); } }
public interface InterfaceB extends InterfaceA { }
public interface InterfaceC extends InterfaceA { }
public class MyClass implements InterfaceB,InterfaceC { }
public class DefaultMethodTest { public static void main(String[] args) { MyClass myClassObj = new MyClass(); myClassObj.sayWelcome(); } }
Welcome by InterfaceA
https://sites.google.com/site/javaee4321/java/DefaultMethodDemo-In-Super_I-App.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/DefaultMethodDemo-In-Super_I-App
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/fa67e02bcd9efeae1c2ea3019677c5252e4db5f7/BasicJava/DefaultMethodDemo-In-Super_I-App/?at=master
See also:
No comments:
Post a Comment