• Post Reply Bookmark Topic Watch Topic
  • New Topic

inner class  RSS feed

 
Jolie Lee
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, just wondering in wat kind of circumstances we will use inner class? and also how to compile it?
 
fred rosenberger
lowercase baba
Bartender
Posts: 12542
48
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They're often used for things like listeners on your GUI components, but there are thousands of times/places where they'll pop up. sometimes as a 'helper' class for the outer class.

You don't need to to anything special to compile it... you can't delcare it in the middle of a method, but otherwise, when you compile the outer class, the inner class is done at the same time.

One of the campfire stories talks about it more... you can find it here.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!