both are working fine to find what type of object has been instantiated but the first method is accepted whereas the second isn't:
person instanceOf Dancer
person.getClass().getSimpleName().equals("Dancer")