package cn.edu.bjut.chapter4; public class Dog extends Animal implements Runable { private double speed; public Dog(String name, double speed) { super(name); this.speed = speed; } @Override public String makeNoise() { return "汪!汪!汪!"; } @Override public double getSpeed() { return speed; } @Override public String toString() { return "Dog [奔跑速度:" + speed + Runable.UNIT + "]"; } }