The ``++instanceof++`` construction is a preferred way to check whether a variable can be cast to some type statically because a compile-time error will occur in case of incompatible types. The method https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html#isInstance-java.lang.Object-[isInstance()] from ``++java.lang.Class++`` works differently and does type check at runtime only, incompatible types will therefore not be detected early in the development, potentially resulting in dead code. The ``++isInstance()++`` method should only be used in dynamic cases when the ``++instanceof++`` operator can't be used.