Class java.lang.ClassCastException
All Packages Class Hierarchy This Package Previous Next Index
Class java.lang.ClassCastException
Object
|
+----Throwable
|
+----Exception
|
+----RuntimeException
|
+----java.lang.ClassCastException
- public class ClassCastException
- extends RuntimeException
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);
- Version:
- 1.13, 07/01/98
- Author:
- unascribed
- Since:
- JDK1.0
-
java.lang.ClassCastException()
- Constructs a
ClassCastException with no detail message.
-
java.lang.ClassCastException(String)
- Constructs a
ClassCastException with the specified
detail message.
ClassCastException
public ClassCastException()
- Constructs a
ClassCastException with no detail message.
- Since:
- JDK1.0
ClassCastException
public ClassCastException(String s)
- Constructs a
ClassCastException with the specified
detail message.
- Parameters:
- s - the detail message.
- Since:
- JDK1.0
All Packages Class Hierarchy This Package Previous Next Index