wood burning stoves*
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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "argument -defined Anonymous inner class " Watch "argument -defined Anonymous inner class " New topic
Author

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.


42
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.

Sanyev
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: argument -defined Anonymous inner class