java.lang
Class ClassCastException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.ClassCastException
- All Implemented Interfaces:
- java.io.Serializable
- public class ClassCastException
- extends RuntimeException
Thrown when an attempt is made to cast an object which is not of the
appropriate runtime type. For example:
Object o = new Vector();
String s = (String) o;
| Nested classes inherited from class java.lang.Throwable |
|
| Fields inherited from class java.lang.Throwable |
|
| Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
serialVersionUID
private static final long serialVersionUID
- Compatible with JDK 1.0+.
- See Also:
- Constant Field Values
ClassCastException
public ClassCastException()
- Create an exception without a message.
ClassCastException
public ClassCastException(String s)
- Create an exception with a message.