Basic Theory:
-----------------------------------------------------
Java internal class: the definition of an internal class is defined within another class.
The reason is:
1. An internal class object can access the implementation of the object created for it, including private data. That is, an internal class instance is privileged to the instance of the class that contains it.
2. for other classes in the same package, the internal class can be hidden. In other words, the internal class, regardless of the method visibility, may be public. In addition to the inclusive class, other classes cannot use it.
3. Anonymous internal classes can easily define callbacks.
4. Use internal classes to easily write event-drivenProgram.
In fact, it is only intended to define callback-further, it is event-driven.
Interface and callback: a common programming mode is the callback mode. In this mode, you can specify the method of the callback object when a specific time occurs.