Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Argument-Defined Anonymous Inner Class  RSS feed

 
Nitin Kulkarni
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a question on the following code

This program outputs "doStuff"
Is there any way that I could get "fluffy" to print out?
I do not know how to access this method that is inside the
Argument-Defined Anonymous Inner Class.

Thanks
[ August 25, 2004: Message edited by: Nitin Kulkarni ]
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since the method doStuff contains the reference to the Foo type object, you can invoke methods of Foo from the doStuff method context.

Is there any way that I could get "fluffy" to print out?

Yes. Change what doStuff does with its Foo reference.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!