[ Web Proxy ]
URL:
Viewing: https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/ClassCastException.html [Back]  [Original]

ClassCastException (Java SE 25 & JDK 25)
Contents 
  1. Description
  2. Constructor Summary
  3. Method Summary
  4. Constructor Details
    1. ClassCastException()
    2. ClassCastException(String)
Hide sidebar Hide sidebar [Hide sidebar]Show sidebar [Show sidebar] Show sidebar

Class ClassCastException

java.lang.Object
All Implemented Interfaces:
Serializable

public class ClassCastException extends RuntimeException
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:


Web Proxy Viewer  |  New URL  |  Original Page