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 anonymous inner class Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "anonymous inner class" Watch "anonymous inner class" New topic
Author

anonymous inner class

pooja jain
greenhorn
Ranch Hand

Joined: Jan 12, 2005
Posts: 213
It is mention in Kathy & Bert book on 467 page . you can even have class within an argument of method that are anonymous inner class . but my doubt is they are not in method argument .


:d
Edwin Dalorzo
Ranch Hand

Joined: Dec 31, 2004
Posts: 961
What do you mean? Somewhat like this satisfies your statement:

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3829
new Base() { int i = 8 ; } ;

Pooja , You can consider this line like , this line is giving an reference of an anonymous class & that anonymous calss is a sub class of this Base class & implementation of that anonymous class is b/w the curly braces ...

So now you can have this statement any place where ever reference is required , in method argument, at the time of assigning to another reference ...

I hope it is right & clear to you ...
[ January 14, 2005: Message edited by: rathi ji ]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: anonymous inner class
 
Similar Threads
Inner class question
Passing an object to a method.
Anonymous Inner class
A question about creating an anonymous inner class
Why doesn't this class compiles?