Package java.lang

Class ClassCastException

  • All Implemented Interfaces:
    Serializable

    public class ClassCastException
    extends RuntimeException
    Thrown when a program attempts to cast a an object to a type with which it is not compatible.
    See Also:
    Serialized Form
    • Constructor Detail

      • ClassCastException

        public ClassCastException()
        Constructs a new ClassCastException that includes the current stack trace.
      • ClassCastException

        public ClassCastException​(String detailMessage)
        Constructs a new ClassCastException with the current stack trace and the specified detail message.
        Parameters:
        detailMessage - the detail message for this exception.