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

hibernate - How to load global settings frequently used in application in Java -

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

objective c - Ownership modifiers with manual reference counting -