Nested classes allow one class to be defined within another. There are two types: non-static nested classes which have access to outer class members, and static nested classes which can access static members only without an outer class instance. Nested classes are useful for code organization, readability and optimization by allowing tighter coupling between classes.