What is an anonymous inner class?

In Java, a class can contain another class known as nested class. It’s possible to create a nested class without giving any name. A nested class that doesn’t have any name is known as an anonymous class. An anonymous class must be defined inside another class. Hence, it is also known as an anonymous inner class.

Read more

What is a local class?

Local classes are classes that are defined in a block, which is a group of zero or more statements between balanced braces . You typically find local classes defined in the body of a method. This section covers the following topics: Declaring Local Classes. Accessing Members of an Enclosing Class.

Read more