PrepZone Logo
PrepZone
Back to Java

Java · Medium

Differentiate between static nested class, inner class, local class, and anonymous class.

JavaCore JavaOOP

Answer preview

Static nested class — Declared with static inside a class. Does not hold a reference to the outer class. Can be instantiated without an outer instance. Best for logically grouping classes that don't need outer class access.…