Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Roundup #232

 
Rob Acraman
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roundup question #232 reads:
A non-static inner-class always has free access to ALL member data of its enclosing class. True or False?
(emphasis from question)
Answer: True.
But what about inner-classes-in-methods. They're not static, but can only access final data.
 
Rob Acraman
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, my mistake. Inner-classes-in-methods and anonymous inner classes can access all class variables, but only final method variables.
I should have checked up before posting, but I was so SURE...!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic