我有以下,
public interface SuperbInterface public class A implements SuperbInterface public class B extends A public class C extends B
我想实例化C但我似乎得到了B,我做错了什么?
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();