java.lang
public class: ClassCastException [javadoc |
source]
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.ClassCastException
All Implemented Interfaces:
Serializable
Thrown to indicate that the code has attempted to cast an object
to a subclass of which it is not an instance. For example, the
following code generates a
ClassCastException:
Object x = new Integer(0);
System.out.println((String)x);
- author:
unascribed -
- since:
JDK1.0 -
| Methods from java.lang.Throwable: |
|---|
|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| Methods from java.lang.Object: |
|---|
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |