Help Center

Local Navigation

Performing casts using instanceof

Use instanceof to evaluate whether a cast succeeds.

Code sample

if( x instanceof String ) {
(String)x.whatever();
} else {
...
}
x

Index


Was this information helpful? Send us your comments.