For :
public A getAnonymousClassForA()
{
return new A(10){public void m1() { S.o.p("anonymousA.m1"); } }
}
The anonymous class ( of the object) that is returned by this method extends class A implicitly. This is the way you can have anonymous class extend any other class.
I did not say that anony. class can "define" constructors. It can "use" the constructors defined by the class it extends.
I do not understand what do you mean by "in addition to outer class". If you are under the impression that anony class always extends outer class then it is wrong.
For:
public I getAnonymousClassForI()
{
return new I(){public void i1() { S.o.p("anonymousI.m1"); } }
}
In this case the anomymous class ( of the object) returned by the method extends Object but implements the interface I.
You question was, "I know ....want to know the syntax...". So I gave just the syntax. Sorry for lack of expl. Does this clear up now?
HTH,
Paul.
------------------
Get Certified, Guaranteed!
http://www.enthuware.com/jqplus