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.
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.
As an alternative make use of isInstance
method:
if (!example.class.isInstance(blarg))
{
// your code here
}