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

python 3.x - Mapping specific letters onto a list of words -

javascript - jquery or ashx not working -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -