Java,
public class Master {
public void play(Pet pet){
if(pet instanceof Dog){
Dog d=(Dog)pet;
d.catchingFlyDisc();
}
else if(pet instanceof Penguin){
Penguin s=(Penguin)pet;
s.swimming();
}
}
这代码什么意思啊
public class Master {
public void play(Pet pet){
if(pet instanceof Dog){
Dog d=(Dog)pet;
d.catchingFlyDisc();
}
else if(pet instanceof Penguin){
Penguin s=(Penguin)pet;
s.swimming();
}
}
这代码什么意思啊
2018-04-17
举报