Hi, This is my first time posting on JavaRanch, great site by the way. My question is about Nested Classes, I know what they are and how they are created, but why would you used them instead of creating a new SubClass?
Joined: Mar 22, 2002
Bruce Eckel has an interesting discussion on inner classes. According to him, inner classes allow you to hide a class that implements an interface. You can also use an inner class if you want to create a class "on the fly".
Joined: Dec 10, 2001
Also, an instance of an inner class would have access to the private members of the enclosing class. An instance of a subclass would not have access to the private members of the superclass instance.