Returns the Class
with the given
binary name in the given module.
This method attempts to locate, load, and link the class or interface.
It does not run the class initializer. If the class is not found, this
method returns null
.
If the class loader of the given module defines other modules and
the given name is a class defined in a different module, this method
returns null
after the class is loaded.
This method does not check whether the requested class is accessible to its caller.
module | A module | |
name | The binary name of the class |
Class
object of the given name defined in the given module;
null
if not found.
NullPointerException | if the given module or name is null | |
LinkageError | if the linkage fails | |
SecurityException
|
|
@apiNote
This method returns null
on failure rather than
throwing a ClassNotFoundException
, as is done by
the forName(String, boolean, ClassLoader)
method.
The security check is a stack-based permission check if the caller
loads a class in another module.
@spec JPMS
Diagram: Class, Package, Module