java.lang
ClassCastException
Declarationpublic class ClassCastException extends RuntimeException
java.lang.Object
|
+--java.lang.Throwable
|
+--java.lang.Exception
|
+--java.lang.RuntimeException
|
+--java.lang.ClassCastException
Description
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 = new Integer(0);
System.out.println((String)x);
Constructors
ClassCastException()
ClassCastException(String s)
Methods inherited from class Object
equals(Object), getClass(), hashCode(), notify(), notifyAll(), wait(), wait(), wait()
Methods inherited from class Throwable
getMessage(), printStackTrace(), toString()
Constructors
ClassCastException()
Declaration:
public ClassCastException()
Description:
Constructs a ClassCastException with no detail message.
ClassCastException(String)
Declaration:
public ClassCastException(java.lang.String s)
Description:
Constructs a ClassCastException with the specified detail message.
Parameters:
s - the detail message.
No comments:
Post a Comment