I have the following script:
public class A { } public class B extends A { } public class C extends B { public void Foo(); }
I have a method that can return a class A , B or C , and I want to safely move to C, but only if the class is type C. This is because I need to call Foo (), but I don't want a ClassCastException.
source share