Members which are types may be declared private or protected . A non- static member class, or a class defined by a block or expression, is an inner class. All other classes are top-level . Inner classes may not declare static members, static initializers, or member interfaces. Package members are never static .
Interfaces are always static , as are their non-method members.
A class may not have the same simple name as any of its enclosing classes. The keyword this can be qualified, to select one of possibly several current instances. ClassBody opt Primary . ClassBody opt A new expression may define an anonymous class by specifying its body. Independently, the type of a new expression may specified as the simple name of an inner class, if an instance of the immediately enclosing class is given as a qualifying expression before the keyword new .