1.写一个Java应用程序,主要是体现父类子类间的继承关系。父类:鸟,子类:麻雀、鸵鸟、鹰。子类继承父类的一些特点,如都是鸟的话就都会有翅膀、两条腿等,但它们各自又有各
package d; public class Bird { int leg=2; int chibang=2; public void cry(){ System.out.println("@#$%^%^&*~~"); } } package d; public class Maque extends Bird{ int age; int weight; public void setAge(int age) { this.age = age; } public void setWeight(int weight) { this.weight = weight; } public void cry(){ System.out.println("Maque-cry"); } public void showMaque(){ System.out.println(age); System.out.println(weight); } } package d; public class tuoniao extends Bird { int height; int speed; public void setHeight(int height) { this.height = height; } public void setSpeed(int weight) { this.speed = speed; } public void cry(){ System.out.println("tuoniao -cry"); } public void showMaque(){ System.out.println(height); System.out.println(speed); } } package d; public class ying extends Bird{ int Catch; int FlySpeed; public void setCatch(int catch1) { Catch = catch1; } public void setFlySpeed(int flySpeed) { FlySpeed = flySpeed; } public void cry(){ System.out.println("ying-cry"); } public void showMaque(){ System.out.println(Catch); System.out.println(FlySpeed); } }