Click here to watch in Youtube :
https://www.youtube.com/watch?v=JJDli5-VQL0&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
class A { public void displayMessage() { System.out.println("Calling Class A displayMessage method"); } } class B { public void displayMessage() { System.out.println("Calling Class B displayMessage method"); } } class C extends A,B //suppose if it were { public static void main(String[] args) { C obj=new C(); /* * Now which displayMessage() method would be invoked? * Class A displayMessage() method or Class B displayMessage() method? */ obj.displayMessage(); } }
https://sites.google.com/site/javaee4321/java/NoMultipleInheritanceDemoApp.zip?attredirects=0&d=1
See also:
No comments:
Post a Comment