public class Test9 {
public static void main(String[] args) {
Animal dg = new Dog();
dg.jiao();
Animal ct = new Cat();
ct.jiao();
}
}
abstract class Animal {
public abstract void jiao();
}
class Dog extends Animal {
public void jiao() {
System.out.println("汪汪汪");
}
}
class Cat extends Animal {
public void jiao() {
System.out.println("喵喵喵");
}