@CallerSensitive
public Class<?> getEnclosingClass () throws SecurityException

Returns the immediately enclosing class of the underlying class. If the underlying class is a top level class this method returns null.

Returns:  the immediately enclosing class of the underlying class

Exceptions:
SecurityException     If a security manager, s, is present and the caller's class loader is not the same as or an ancestor of the class loader for the enclosing class and invocation of s.checkPackageAccess() denies access to the package of the enclosing class

Since:  1.5