four types:
static inner class: really should not be called inner class, especially
public one. I hardly find it useful But I did see somebody uses it to
emphasize the domain relationship.
inner class: mostly be used for event listeners or for limiting publication
scope to the enclosing class. Occasionally it might escape from class scope.
method local inner class: never use it. you use it when you really want to
limit it's life scope. It is the preferred question for an interview: about
what kind of variables you an access from it.
anonymous class: can be at class, object or method level. used a lot for
event listeners especially in Swing.