A class declared with in a function is called as anonymous inner class.

A class declared in a block or function with out any name is called as anonymous inner class.

A static class declared in a block with out any name is called as anonymous inner class.

Answer :(C)

A class declared in a block or function with out any name is called as anonymous inner class.

Description :

A class declared in a block or function with out any name is called as anonymous inner class.
Generally we use anonymous inner classes while implementing an interface or while extending a class.
For example, you can write a thread functionality by using an anonymous inner class:
new Thread(){
public void run(){
System.out.println("thread is running");
}
}.start();
In the above example we are implementing a thread with out giving any class name, and running that thread immediately.
Purpose of anonymous inner classes:
1. If you want to have different implementations for different objects, then you can go for anonymous inner classes.
eg: you are having 3 buttons, and you want to give three different onclick definitions for 3 buttons, then you can use different anonymous class for each button.
2. If you want to use a class definition in only one place, and you don't want any one to use that class definition, then go for it. This can be used as a security feature. (Increased encapsulation)