I have the following,
public interface SuperbInterface
public class A implements SuperbInterface
public class B extends A
public class C extends B
I want to instantiate C but I seems to be getting B, what did I do wrong?
Class classz = Class.forName("C");
SuperbInterface superb = (SuperbInterface)classz.newInstance();
//Here when I debug it seems to be going to B.doWork() methods instead of C.doWork().
superb.doWork();
C?? please show the relevant code fully