To check if an object is not an instance of a class, use the logical NOT (!) operator to negate the use of the instanceof operator – !( obj instanceof Class) .
To check if an object is not an instance of a class, use the logical NOT (!) operator to negate the use of the instanceof operator – !( obj instanceof Class) .