This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
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

Win a copy of Head First Android this week in the Android forum!
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
jQuery in Action, 3rd edition