Object-oriented programming in Java.
Many compelling reasons are present to use the nested classes. Among them: Grouping of classes is done logically which are just used at 1 place.Encapsulation is increasedNested classes might be leading to more maintainable & readable code.
Logical classes groupings—When one class is useful towards just 1 class, it would be so logical to do its embedding in that particular class so that to keep them together. They are known as the helper classes