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

Is this correct?

 
Yuan Ye
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An instance of an Anonymous inner class can only be created in it's outer class.
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An anonymous class can also be defined as an argument to a method or somewhere inside the method.
 
Brian Joseph
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question is confusing. When the question reads "in the outer class", is this just referring to "class scope", meaning within the class definition but outside of any method definition blocks?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic