home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / Java2 / src / java / lang / ClassCastException.java < prev    next >
Encoding:
Java Source  |  1999-05-28  |  1.3 KB  |  49 lines  |  [TEXT/CWIE]

  1. /*
  2.  * @(#)ClassCastException.java    1.15 98/09/21
  3.  *
  4.  * Copyright 1994-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.lang;
  16.  
  17. /**
  18.  * Thrown to indicate that the code has attempted to cast an object 
  19.  * to a subclass of which it is not an instance. For example, the 
  20.  * following code generates a <code>ClassCastException</code>: 
  21.  * <p><blockquote><pre>
  22.  *     Object x = new Integer(0);
  23.  *     System.out.println((String)x);
  24.  * </pre></blockquote>
  25.  *
  26.  * @author  unascribed
  27.  * @version 1.15, 09/21/98
  28.  * @since   JDK1.0
  29.  */
  30. public
  31. class ClassCastException extends RuntimeException {
  32.     /**
  33.      * Constructs a <code>ClassCastException</code> with no detail message. 
  34.      */
  35.     public ClassCastException() {
  36.     super();
  37.     }
  38.  
  39.     /**
  40.      * Constructs a <code>ClassCastException</code> with the specified 
  41.      * detail message. 
  42.      *
  43.      * @param   s   the detail message.
  44.      */
  45.     public ClassCastException(String s) {
  46.     super(s);
  47.     }
  48. }
  49.