a3 move to Question1

This commit is contained in:
2022-04-11 13:59:00 +08:00
parent 8ae38c9f2b
commit 8fe0ec8e12
7 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
/*
* Author: CHEN Yongyuan (Walter) 1930006025 from OOP(1007)
* Date: 2022-04-11
* Description: Human class
*/
public class Human extends Mammal {
/**
* Constructor.
*
* The Constructor take no argument. All human are named "Alice"
*/
public Human() {
super("Alice");
}
/**
* Human cannot be cooked.
*
* @return false
*/
@Override
public boolean isCookable() {
return false;
}
/**
* Test.
*/
public static void testHuman() {
Human human = new Human();
System.out.println(human.getName() == "Alice");
System.out.println(human.isCookable() == false);
}
}