Java - (Inner|Nested) Class
About
The Java programming language allows you to define a class within another class.
Articles Related
Nested or Inner ?
class OuterClass {
...
static class StaticNestedClass {
...
}
class InnerClass {
...
}
}
When to use ?
If a class is useful to only one other class, then it is logical to embed it in that class and keep the two together.
It increases encapsulation but increase dependency
If you want to implement an hierarchy like of object see also
Tree - Composite Type (Design Pattern)Documentation / Reference