Hi, I have the following scenario:
public class A {
}
public class B extends A {
}
public class C extends B {
public void Foo();
}
I have a method that can return me class A, B or C and I want to cast safely to C but only if the class I get is of type C. I need to call Foo() but I don't want the ClassCastException.