dog无法强制类型转换
为什么强制类型转换的时候会报错?
public static void main(String[] args) { Dog dog = new Dog(); Animal animal = new Animal(); Dog dog2 = (Dog) animinal; //编译器会报错 }
为什么强制类型转换的时候会报错?
public static void main(String[] args) { Dog dog = new Dog(); Animal animal = new Animal(); Dog dog2 = (Dog) animinal; //编译器会报错 }
2016-04-08
举报