0
Nested classes are divided into two categories.
Static:
A static nested class interacts with the instance members of its outer class (and other classes) just like any other top-level class.
class OuterClass {
...
static class StaticNestedClass {
...
}
}
Non-static(inner):
An instance of InnerClass can exist only within an instance of OuterClass and has direct access to the methods and fields of its enclosing instance.
class OuterClass {
...
class InnerClass {
...
}
}