Lolmister Lolmister - 7 months ago 56
Java Question

The opposite of instanceof

Is it possible to get the opposite of instanceof in java? I have tried code like this:

if( example !instanceof blarg)....

but it won't let me put the ! anywhere without an error, please help.


You have to negate the entire thing:

if(!(example instanceof blarg))