Java Platform 1.2
Beta 4

Class 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);

See Also:
Serialized Form

Constructor Summary
          Constructs a ClassCastException with no detail message.
ClassCastException(String s)
          Constructs a ClassCastException with the specified detail message.
Methods inherited from class java.lang.Throwable
fillInStackTrace , getLocalizedMessage , getMessage , printStackTrace , printStackTrace , printStackTrace , toString
Methods inherited from class java.lang.Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , wait , wait , wait

Constructor Detail


public ClassCastException()
Constructs a ClassCastException with no detail message.


public ClassCastException(String s)
Constructs a ClassCastException with the specified detail message.
s - the detail message.

Java Platform 1.2
Beta 4

Submit a bug or feature
Submit comments/suggestions about new javadoc look
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.
This documentation was generated with a post-Beta4 version of Javadoc.