Skip to content

Glossary: Java Beyond the Basics

Nested and anonymous classes

Also written: anonymous classes, nested classes

A nested class is declared inside another class, and an anonymous class is declared with no name at the point where it is used. Older code often used anonymous classes for the short behaviors that lambdas now express.

Where the book teaches it

Related terms

Lambda