I have a class, which has a bunch of subclasses that inherit from it. How can I test to see whether an object is an instance of that super class, and not of any of the derived classes?
Example:
I have a Vehicle class, and it has several classes that inherit from it, like Car, Motorcycle, Bicycle, Truck, etc.
Assuming this, how do I test to see if a Vehicle object is really of the class Vehicle, and not Car or Bicycle? (Since a Car and a Bicycle are in this case an instance of the Vehicle class, too.)
1 Answer