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