File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes argument -defined Anonymous inner class 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 "argument -defined Anonymous inner class " Watch "argument -defined Anonymous inner class " New topic

argument -defined Anonymous inner class

K Anshul
Ranch Hand

Joined: May 19, 2004
Posts: 71

iMethod is overridden in an argument. Is there any way i can call iMethod() and print "Argument" on the screen.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
if IFace defines the method you can call it.
If not, tough luck.

Sanyev Babu
Ranch Hand

Joined: Dec 18, 2003
Posts: 132

Since it is a argument local inner class you can call the overloaded iMethod only from inside the method. The code above will print Argument. but it is called from within the method.

I agree. Here's the link:
subject: argument -defined Anonymous inner class
It's not a secret anymore!