public class TestAnimal {
public void bite() {
}
public static void main(String[] args) {
TestAnimal A = new Cat();
TestAnimal B = new Dog();
A.bite();
B.bite();
}
}
class Cat extends TestAnimal {
public void bite() {
System.out.println("This is Cat:MiaoMiao is bitting");
}
}
class Dog extends TestAnimal {
public void bite() {
System.out.println("This is Dog:WangWang is bitting");
}
public void bite() {
}
public static void main(String[] args) {
TestAnimal A = new Cat();
TestAnimal B = new Dog();
A.bite();
B.bite();
}
}
class Cat extends TestAnimal {
public void bite() {
System.out.println("This is Cat:MiaoMiao is bitting");
}
}
class Dog extends TestAnimal {
public void bite() {
System.out.println("This is Dog:WangWang is bitting");
}
}