public abstract class Animal {
abstract void cry();
abstract String getAnimalName();
}
public class Simulator {
public void playSound(Animal animal){
System.out.println("动物的种类是:"+animal.getAnimalName());
animal.cry();
}
}
public class Dog
public abstract class Animal {
abstract void cry();
abstract String getAnimalName();
}
public class Simulator {
public void playSound(Animal animal){
System.out.println("动物的种类是:"+animal.getAnimalName());
animal.cry();
}
}
public class Dog