Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

argument -defined Anonymous inner class

 
K Anshul
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


iMethod is overridden in an argument. Is there any way i can call iMethod() and print "Argument" on the screen.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if IFace defines the method you can call it.
If not, tough luck.
 
Sanyev Babu
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic