对象类引用变量可引用由某个接口引用变量挖掘的引用。我们知道Interface不能扩展任何类。因此,Object类的默认继承将适用于这种情况。很显然,答案是肯定的,但是这背后的逻辑是什么?对象类继承与接口
public interface ToTest {
}
public class ToTestImpl implements ToTest{
}
public class ToTestClass {
public static void main(String args[]){
ToTest test = new ToTestImpl();
Object o = test;
System.out.println(o);
}
}