Package java.lang
Class ClassNotFoundException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.ClassNotFoundException
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs aClassNotFoundExceptionwith no detail message.ClassNotFoundException(String string) Constructs aClassNotFoundExceptionwith the specified detail message.ClassNotFoundException(String string, Throwable ex) Constructs aClassNotFoundExceptionwith the specified detail message and optional exception that was raised while loading the class. -
Method Summary
Modifier and TypeMethodDescriptiongetCause()Returns the cause of this exception (the exception that was raised if an error occurred while attempting to load the class; otherwisenull).Returns the exception that was raised if an error occurred while attempting to load the class.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ClassNotFoundException
public ClassNotFoundException()Constructs aClassNotFoundExceptionwith no detail message. -
ClassNotFoundException
Constructs aClassNotFoundExceptionwith the specified detail message.- Parameters:
string- the detail message.
-
ClassNotFoundException
Constructs aClassNotFoundExceptionwith the specified detail message and optional exception that was raised while loading the class.- Parameters:
string- the detail messageex- the exception that was raised while loading the class- Since:
- 1.2
-
-
Method Details
-
getException
Returns the exception that was raised if an error occurred while attempting to load the class. Otherwise, returnsnull.This method predates the general-purpose exception chaining facility. The
Throwable.getCause()method is now the preferred means of obtaining this information.- Returns:
- the
Exceptionthat was raised while loading a class - Since:
- 1.2
-
getCause
Returns the cause of this exception (the exception that was raised if an error occurred while attempting to load the class; otherwisenull).
-