12.7 Finalization of Classes

If a class declares a class method classFinalize that takes no arguments and returns no result:

static void classFinalize() throws Throwable { . . . }

then this method will be invoked before the class is unloaded (§12.8). Like the finalize method for objects, this method will be automatically invoked only once. This method may optionally be declared private, protected, or public.