CoreJava/exp3/AnimalExtendsTest.java

14 lines
270 B
Java
Raw Permalink Normal View History

2024-05-09 09:10:51 +08:00
package exp3;
public class AnimalExtendsTest {
public static void main(String[] args){
Cat cat = new Cat();
Dog dog = new Dog("大黄", 5, "黄色", "金毛");
cat.walk();
cat.miaow();
dog.run();
dog.bark();
}
}