[]
, that is, an array of components of type SC, then:
Object
(§2.4.6).
[]
, that is, an array of components of type TC, then one of the following must be true:
Linking Exceptions
During resolution of the CONSTANT_Class
constant pool item, any of the exceptions documented in §5.1 can be thrown.
Runtime Exception
Otherwise, if objectref cannot be cast to the resolved class, array, or interface type, the checkcast instruction throws a ClassCast
-Exception
.
Notes
The checkcast instruction is very similar to the instanceof instruction. It differs in its treatment of null
, its behavior when its test fails (checkcast throws an exception, instanceof pushes a result code), and its effect on the operand stack.
Contents | Prev | Next | Index
Java Virtual Machine Specification (HTML generated by dkramer on February 25, 1997)
Copyright © 1996 Sun Microsystems, Inc.
All rights reserved
Please send any comments or corrections to doug.kramer@sun.com