• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inner class design motivation docs...

 
Jim Crawford
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I'd like some background on why all the different types of classes, inner classes especially, are included in the language. I can think up some reasons, but I would like some literature. Doubt the JLS or such deals with this.
Example: Why implement an anonymous class in your method? When is it a good idea and when not?
ps. Try to post a link before moving away the thread because its not 'an SCJP objective'... ;-) Kidding.

 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java Tutorial from Sun
Campfire Story
Inner Class Specification
I hope some of those are useful to you.
 
Barkat Mardhani
Ranch Hand
Posts: 787
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jim:
You can also read
web page
In nutshell, inner class facility in Java is a construct for providing multiple inheritance. Two unrelated classes in different inheritance hierarchies can be merged by placing one into the other textually. Hence, the one inside (the inner class) can access (sort of inherit) all members from outer classes.
Once you will read the literature, you will find proper and improper use of inner classes.
Thanks
Barkat
 
Jim Crawford
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. Will check it out.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic