| Author |
creating objects in java
|
Satyajeet Kadam
Ranch Hand
Joined: Oct 19, 2006
Posts: 202
|
|
In above example example object is created in different way instead of using Foo f=new Foo(); f.m(); Is it A Annonymous inner class? Please explain
|
 |
Srinivasan thoyyeti
Ranch Hand
Joined: Feb 15, 2007
Posts: 557
|
|
Hi, you are correct. it is Anonymous Inner class. (new Foo(){ }).m(); we are extending Foo class creating Object of that class. So eventually by inheritance new child of Foo can access m().
|
Thanks & Regards,<br />T.Srinivasan,<br />SCWCD 1.4(89%),SCJP 5.0(75%)<br />"That service is the noblest which is rendered for its own sake." - Mahatma Gandhi
|
 |
 |
|
|
subject: creating objects in java
|
|
|