Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

method local inner class doubt  RSS feed

 
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?
 
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
Boost this thread!