Nested classes allow one class to be defined within another. There are several types of nested classes in Java including static nested classes, inner classes, local classes, and anonymous classes. Static nested classes cannot access non-static members of the outer class but inner classes can. Local classes are defined within a method and anonymous classes do not have a name but inherit from a class or implement an interface.