Table of Contents

Java - (Inner|Nested) Class

About

The Java programming language allows you to define a class within another class.

Nested or Inner ?

class OuterClass {
    ...
    static class StaticNestedClass {
        ...
    }
    class InnerClass {
        ...
    }
}

When to use ?

If you want to implement an hierarchy like of object see also Tree - Composite Type (Design Pattern)

Documentation / Reference