The instanceof operation is the best option for two reasons:
1) It handles subtyping, so if you have an instance of a subclass/subtype you would still get true.
2) It handles null, so null instanceof Class would return false
If you take an object's class and then compare to another class, you're risking taking the class of a null object, and you can't directly get subtyping.
If you work with objects that represent classes, you can use the reflection operations, since instanceof would refer to their own class, Class, rather than to the class they represent.