Inner Class. What is its purpose?
Can someone tell me what the purpose of having inner classes? I can think of a few but may be they are not good reasons for using inner classes. My reasoning is that inner class is helpful when you want to use a class that no other classes can use. What else? Inner classes can be used to simulate closures: http://en.wikipedia.org/wiki/Closure_(computer_science)#Java When I was learning Java we used inner classes for GUI event handling classes. It is sort of a "one time use" class that need not be available to other classes, and only is relevant to the class in which it resides. I use inner