java.lang
Class ClassCastException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- java.lang.ClassCastException
-
public class ClassCastException extends RuntimeException
Thrown when a program attempts to cast a an object to a type with which it is not compatible.
-
-
Constructor Summary
Constructors Constructor and Description ClassCastException()
Constructs a newClassCastException
that includes the current stack trace.ClassCastException(String detailMessage)
Constructs a newClassCastException
with the current stack trace and the specified detail message.
-
Method Summary
-
Methods inherited from class java.lang.Throwable
fillInStackTrace, getMessage, getStackTrace, printStackTrace, printStackTrace, toString
-
-
-
-
Constructor Detail
-
ClassCastException
public ClassCastException()
Constructs a newClassCastException
that includes the current stack trace.
-
ClassCastException
public ClassCastException(String detailMessage)
Constructs a newClassCastException
with the current stack trace and the specified detail message.- Parameters:
detailMessage
- the detail message for this exception.
-
-