How to find out the subclass from the base class object
- by Vaishak Suresh
Is there a way to find out the derived class's name from a base class object?
ex:
class A{
....
}
class B extends A{
...
}
class c extends A{
...
}
now if a method returns an object of A, can I find out if it is of type B or C?