File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes creating objects in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "creating objects in java" Watch "creating objects in java" New topic
Author

creating objects in java

Satyajeet Kadam
Ranch Hand

Joined: Oct 19, 2006
Posts: 215


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, T.Srinivasan
SCWCD 1.4(89%), SCJP 5.0(75%)
 
GeeCON Prague 2014
 
subject: creating objects in java