For instanceof you need to know the exact class at compile time.
if (foo instanceof ThisClassIKnowRightNow)
...
For isInstance the class is decided at run time. (late binding) e.g.
if (someObject.getClass().isInstance(foo))
...
For instanceof you need to know the exact class at compile time.
if (foo instanceof ThisClassIKnowRightNow)
...
For isInstance the class is decided at run time. (late binding) e.g.
if (someObject.getClass().isInstance(foo))
...