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);
Submit a bug or feature Java, Java 2D, and JDBC are a trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 1993-1999 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.