Gangireddy Danam wrote:...if i want to call method1()..how could may i call..?
can anonymous classes will replace constructors..?
Basically, using a Pop reference, you can't, as the Method1() method is not in scope for the Pop class. The likely / common answer is that you need to cast the variable, but since it was instantiated from an anonymous class, the class definition is out of scope -- and hence, you can't cast it either.... So, your only option is to use the reflection libraries.
Henry