
本文共 2234 字,大约阅读时间需要 7 分钟。
���������Polymorphism���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������
������������������������������������������������������������
���������������������������������
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������������
������
- ���������������������������������������������-���������������������������������������������������������
- ������������������������������������������������������������������������������������
####������
- ���������������������������������������������������������������������������������������������������
������������������������
Vehicle myVehicle = new Car();
���������������myVehicle
������������������Car���������
Car myCar = (Car) myVehicle;
���������������������������������������
������������������������������������instanceof
������������������������������������������������������������������������������
if (myVehicle instanceof Car) { Car myCar = (Car) myVehicle; System.out.println(myCar������); //������������������������}
���������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
发表评论
最新留言
关于作者
