I have this object which is an instance of a superclass. I want to know which subclass that object really is, so that I can decide what to do with it. There is this getClass() method but it’s apparently not used for comparison issues. How can I get the sub-type of my object?
Share
You may have a design flaw if you’re trying to do this but
instanceof.See Beware of instanceof operator.