Monday, 2 September 2013

What does it mean isInstance is a 'dynamic equivalent' of instanceof?

What does it mean isInstance is a 'dynamic equivalent' of instanceof?

What does it mean 'dynamic equivalent'?
I just wonder what is the purpose of having
this.getClass().isInstance(aClass) instead of this instanceof aClass? Is
there a difference?
Determines if the specified Object is assignment-compatible with the
object represented by this Class. This method is the dynamic equivalent of
the Java language instanceof operator

No comments:

Post a Comment