java.lang
Class ClassCastException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended byjava.lang.ClassCastException
All Implemented Interfaces:
Serializable

public class ClassCastException
extends RuntimeException

This runtime exception is thrown when a program attempts to cast a an object to a type which it is not compatible with.

See Also:
Serialized Form

Constructor Summary
ClassCastException()
          Constructs a new instance of this class with its walkback filled in.
ClassCastException(java.lang.String detailMessage)
          Constructs a new instance of this class with its walkback and message filled in.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassCastException

public ClassCastException()
Constructs a new instance of this class with its walkback filled in.


ClassCastException

public ClassCastException(java.lang.String detailMessage)
Constructs a new instance of this class with its walkback and message filled in.

Parameters:
detailMessage - String The detail message for the exception.