Top Description Fields Constructors
java.lang

public Class ClassCastException

extends RuntimeException
Class Inheritance

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 = Integer.valueOf(0);
    System.out.println((String)x);
Since
1.0

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
ClassCastException()

Constructs a ClassCastException with no detail message.

public
ClassCastException(String
the detail message.
s
)

Constructs a ClassCastException with the specified detail message.

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.RuntimeException.serialVersionUID.

Annotations
@Serial

Constructor Detail

ClassCastExceptionback to summary
public ClassCastException()

Constructs a ClassCastException with no detail message.

ClassCastExceptionback to summary
public ClassCastException(String s)

Constructs a ClassCastException with the specified detail message.

Parameters
s:String

the detail message.