Skip to main content
Static Nested Classes
- Static nested classes are inner classes marked with the static modifier.
- A static nested class is not an inner class, it's a top-level nested class.
- Because the nested class is static, it does not share any special
relationship with an instance of the outer class. In fact, you don't
need an instance of the outer class to instantiate a static nested
class.
- Instantiating a static nested class requires using both the outer
and nested class names as follows: BigOuter.Nested n = new
BigOuter.Nested();
- A static nested class cannot access non-static members of the outer
class, since it does not have an implicit reference to any outer
instance (in other words, the nested class instance does not get an
outer this reference).