If class B and class C extend class A and I have an object of type B or C, how can I determine of which type
B
C
A
There is also an .isInstance method on the "Class" class. if you get an object's class via myBanana.getClass() you can see if your object myApple is an instance of the same class as myBanana via
Class
myBanana.getClass()
myApple
myBanana
myBanana.getClass().isInstance(myApple)