The left argument must be a class (not necessarily known at compile time)

The right argument must be a class (not necessarily known at compile time)

The left argument can be a primitive

About isInstance():

The left argument must be a class (not necessarily known at compile time)

The right argument must be a reference to an object (eventually null)

The left argument cannot be null

Conclusion

The isAssignableFrom() and isInstance() methods are more flexible than instanceof in that they do not require to know the right argument at compile time.

The left argument of instanceof can be null, contrary to the isAssignableFrom() and isInstance() methods.

The instanceof statement cannot be used with primitives.

Only isInstance() can take a null right parameter without a generating compile time issue or throwing a NullPointerException at runtime.

Only instanceof and isAssignableFrom() can be used to directly test interface implementation.

Therefore, the most stress-free solution to check whether an object (null or not) can be cast without triggering an exception at runtime is isInstance(). However, it cannot be used to check whether a Class implements an interface. In this case, isAssignableFrom() remains the best solution.

Therefore, the most stress-free solution to check whether an object (null or not) can be cast without triggering an exception at runtime is isInstance().However, it cannot be used to check whether a Class implements an interface. In this case, isAssignableFrom() remains the best solution.