Nested classes allow one class to be defined within another class. There are two types of nested classes - non-static and static. Non-static nested classes, also called inner classes, can access private members of the outer class and can be used to make classes private. There are three types of inner classes - inner classes, method-local inner classes defined within a method, and anonymous inner classes declared without a class name at the same time they are instantiated.