How to test if one java class extends another at runtime?
Are you looking for: Super.class.isAssignableFrom(Sub.class)
Are you looking for: Super.class.isAssignableFrom(Sub.class)
I found one mechanism, where at least we are prompted to announce the overridden method explicitly. It’s not the perfect way though. Suppose, we have few pure virtual methods in the base class B: class B { virtual void foo () = 0; virtual void bar (int) = 0; }; Among them, suppose we want … Read more