yrynnmos isssxhat
yrynnmos isssxhat voted up Broad Kenny's answer

The reason that the performance of instanceof and getClass() == ... Is different is that they are doing different things.

  • instanceof tests     whether the object reference on the left-hand side (LHS) is an instance of     the type on the right-hand side (RHS) or some subtype.
  • getClass()     == ... … Read more