Explain anonymous Class in Java -


when program run display function gets called. not able understand how?

class {     class b     {         void display()         {             system.out.println("display in b.....");         }     } }  class twenty extends a.b {     twenty(a temp)     {        temp.super();     }     public static void main(string args[])     {         obj=new a();         twenty abc=new twenty(obj);         abc.display();     } } 

explain program

this simple class twenty extending class b.

since there method display in b class, twenty inherits method if method declared in it. why able call display method on object of class twenty abc.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -