While applying instanceof, you require to apprehend the class of B at compile-time and instanceof can solely be applied with reference types, not primitive types.
While using isAssignableFrom() it can be powerful and vary during runtime and isAssignableFrom() can be done with any class objects:
To learn more click here.