This commit is contained in:
2022-03-19 17:47:52 +08:00
parent 6bf672bd5b
commit 1c8f95c4b3
35 changed files with 1597 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
/*
* Author: CHEN Yongyuan (Walter) 1930006025 from OOP(1007)
* Date: 2022-03-19
* Description: This is the Chicken class.
*/
public class Chicken extends Bird {
/**
* Constructor of Chicken class. A chicken always has a weight of 5.0 and an
* altitude of 0.0. Chicken spend all their time on the ground.
*
* @param name
*/
public Chicken(String name) {
super(name, 5.0, 0.0);
}
/**
* Test.
*/
public static void testChicken() {
Chicken chk1 = new Chicken("chicken1");
System.out.println(chk1.getName() == "chicken1");
System.out.println(chk1.getWeight() == 5.0);
System.out.println(chk1.getAltitude() == 0.0);
}
}