Package java.lang
Class ClassCastException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- java.lang.ClassCastException
-
- All Implemented Interfaces:
Serializable
,Modified
public class ClassCastException extends RuntimeException
Thrown when a program attempts to cast a an object to a type with which it is not compatible.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor 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
getMessage, 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.
-
-