You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
333 B
14 lines
333 B
/**
|
|
* 狗类,继承动物抽象类,实现游泳接口
|
|
*/
|
|
public class Dog extends Animal implements Swimmable {
|
|
@Override
|
|
public void makeSound() {
|
|
System.out.println("狗叫:汪汪汪!");
|
|
}
|
|
|
|
@Override
|
|
public void swim() {
|
|
System.out.println("狗在游泳:狗刨式前进!");
|
|
}
|
|
}
|