Oracle's Java Tutorials have some page about
nested classes and inner classes.
One thing to be aware of is this: an instance of an inner class is associated with an instance of its enclosing class. (That's also why you can access member variables from the enclosing class inside the inner class).
When you create a new instance of the inner class in a constructor or non-static method of the enclosing class, the enclosing class instance that the inner class instance will be associated with is the 'this' of the enclosing class.
When creating a new instance of the inner class in a static context (for example, a static method of the enclosing class), you must explicitly indicate the instance of the enclosing class that the inner class instance must be associated with. You do this by calling the
new operator for the inner class on an instance of the enclosing class.