Class.forName

Class.forName

Class Overview | Class Members | This Package | All Packages

Syntax
public static native Class forName( String className ) throws ClassNotFoundException
Parameters
className
the fully qualified name of the desired class.
Returns
the Class descriptor for the class with the specified name.
Description
Returns the Class object associated with the class with the given string name. Given the fully-qualified name for a class or interface, this method attempts to locate, load and link the class. If it succeeds, returns the Class object representing the class. If it fails, the method throws a ClassNotFoundException.

For example, the following code fragment returns the runtime Class descriptor for the class named java.lang.Thread:

Exceptions
ClassNotFoundException if the class could not be found.