aspose file tools*
The moose likes Beginning Java and the fly likes use of inner class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "use of inner class" Watch "use of inner class" New topic
Author

use of inner class

Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 751
Can anybody explain me the usage of inner class and where it is being used in the java api ?


Jigar Naik


Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

if a class is designed to a single class usage i.e,If a class[say class A] is useful to only one other class[say class B], then nesting A into B makes sense.

in Java API : *java.util.LinkedList* uses Entry nested class as a Node

hth
Lalit Mehra
Ranch Hand

Joined: Jun 08, 2010
Posts: 383

its useful in cases when you need a user defined type accessible to only a single class ... i.e. it should not be accessed elsewhere


http://plainoldjavaobject.blogspot.in
Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 751
Thanks a lot

Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 751
Thanks a lot

Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Jigar Naik wrote:Thanks a lot

you are welcome
Lalit Mehra
Ranch Hand

Joined: Jun 08, 2010
Posts: 383

Jigar Naik wrote:Thanks a lot



you are welcome brother
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: use of inner class
 
Similar Threads
Inner Classes
Question in K&B Book - protected class
Private
Passing an object to a method.
Inner Classes