Files
oop/assignment3/Question2/Human.java
2022-04-11 14:06:40 +08:00

37 lines
602 B
Java

/*
* 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);
}
}