package chaoxingerya;
public class work02 {
public static void main(String[] args) {
Animal c = new Cat();
c.shout();
Animal d = new Dog();
d.shout();
}
}
class Animal{
public void shout(){
}
}
class Cat extends Animal{
@Override
public void shout(){
System.out.println(“喵喵”);
}
}
class Dog extends Animal{
@Override
public void shout(){
System.out.println(“旺旺”);
}
}