I have three classes (Carnivore, Herbivore, and Plant) that extend another class (Organism). How can I tell which subclass an
Carnivore
Herbivore
Plant
Organism
objInstance instanceof Carnivore. Here objInstance is the object you want to test.
objInstance instanceof Carnivore