1. /*
  2. * @(#)ClassCastException.java 1.17 00/02/02
  3. *
  4. * Copyright 1994-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.lang;
  11. /**
  12. * Thrown to indicate that the code has attempted to cast an object
  13. * to a subclass of which it is not an instance. For example, the
  14. * following code generates a <code>ClassCastException</code>:
  15. * <p><blockquote><pre>
  16. * Object x = new Integer(0);
  17. * System.out.println((String)x);
  18. * </pre></blockquote>
  19. *
  20. * @author unascribed
  21. * @version 1.17, 02/02/00
  22. * @since JDK1.0
  23. */
  24. public
  25. class ClassCastException extends RuntimeException {
  26. /**
  27. * Constructs a <code>ClassCastException</code> with no detail message.
  28. */
  29. public ClassCastException() {
  30. super();
  31. }
  32. /**
  33. * Constructs a <code>ClassCastException</code> with the specified
  34. * detail message.
  35. *
  36. * @param s the detail message.
  37. */
  38. public ClassCastException(String s) {
  39. super(s);
  40. }
  41. }