where we can use static members
They do not have names, and they can be instantiated only once. The following is an example of an anonymous class: Because an anonymous class doesn't have a normal class declaration where it's possible to use static, it cannot be declared static. 2. Local.