While a top level nested class is associated with a class, a member class is associated with an object. The enclosing object must be instantiated in order to access the member class . They cannot have static members. A local class is one that is declared within a block of code. It can be used ONLY within the block of code in which it is defined.
Local classes can use variables from the enclosing scope only if they are final.
This would result in an anonymous class. The more we study these inner classes, the more you should be convinced that it makes for very hard code to read. It is a good idea to avoid them . However, as we shall see later, they are actually quite handy when work with client side Java for graphical interfaces. Anonymous classes can be subclasses or an interface implementation.