Java - is there a "subclassof" like instanceof?

rasgo picture rasgo · Apr 23, 2010 · Viewed 29.8k times · Source

Im overriding an equals() method and I need to know if the object is an instance of a Event's subclass (Event is the superclass). I want something like "obj subclassof Event". How can this be made?

Thanks in advance!

Answer

Ken Bloom picture Ken Bloom · Apr 23, 2010

instanceof can handle that just fine.