In Java how do I go about determining what classes a class extends?
public class A{
}
public class B extends A{
}
public class C extends A{
}
public class
You should try to avoid type checking and instead implement functions in B, C and E that do what you want, have the A and D versions do nothing, and then call that function from within your doSomething class.
If you do type checking it's not very maintainable because when you add new classes you need to change the conditional logic.
It's this problem that classes and overriding are there to prevent.