Package java.lang
Class ClassNotFoundException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.ClassNotFoundException
-
- All Implemented Interfaces:
Serializable
public class ClassNotFoundException extends Exception
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ClassNotFoundException()Constructs 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ThrowablegetCause()Returns the cause of this exception (the exception that was raised if an error occurred while attempting to load the class; otherwise null).ThrowablegetException()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 Detail
-
ClassNotFoundException
public ClassNotFoundException()
Constructs aClassNotFoundExceptionwith no detail message.
-
ClassNotFoundException
public ClassNotFoundException(String string)
Constructs aClassNotFoundExceptionwith the specified detail message.- Parameters:
string- the detail message.
-
ClassNotFoundException
public ClassNotFoundException(String string, Throwable ex)
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 Detail
-
getException
public Throwable getException()
Returns the exception that was raised if an error occurred while attempting to load the class. Otherwise, returns null.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
-
-