Why Nested Classes in Java
Introduction to and motivation for using nested classes in Java
Published in
2 min readJul 15, 2022
Nested classes, as the name suggests, are classes defined inside another class. They can be of two types,
- Static. Known as nested static classes. They can’t access members of the outer class.
- Non-static. Known as inner classes. They can access members of the…