CARVIEW |
Select Language
HTTP/1.1 200 OK
Server: AkamaiNetStorage
Content-Type: text/html
ETag: "108143a6a3096d287cd038514685ebf2:1752579106.011485"
Vary: Accept-Encoding
Content-Encoding: gzip
Cache-Control: max-age=21600
Date: Sun, 20 Jul 2025 13:51:10 GMT
Content-Length: 3745
Connection: keep-alive
ClassCastException (Java SE 24 & JDK 24)
Class ClassCastException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.ClassCastException
- All Implemented Interfaces:
Serializable
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
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs aClassCastException
with no detail message.Constructs aClassCastException
with the specified detail message. -
Method Summary
Methods declared in class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ClassCastException
public ClassCastException()Constructs aClassCastException
with no detail message. -
ClassCastException
Constructs aClassCastException
with the specified detail message.- Parameters:
s
- the detail message.
-