Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

method local inner class doubt

 
adam Lui
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


how is it possible to use that f() in localInner?
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by adam Lui:
...how is it possible to use that f() in localInner?

localInner.f() does not work because f() is not static (and inner classes cannot have static declarations). So you would need to create an instance of localInner, and call the method using that instance.
[ November 14, 2007: Message edited by: marc weber ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic