Close: #1 Lab 7

This commit is contained in:
2022-04-03 15:14:47 +08:00
parent 85b623f65f
commit 80ae76b597
53 changed files with 2677 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
/**
* Answer to Question.
*
* Answer to Question 1:
*
* - Q: Should the getLegs methods be abstract? Why or why not?
*
* - A: Yes. Because different animal have different number of legs. In animal
* class we didn't define how many legs an animal has.
*
* - Q: Should the canFly methods be abstract? Why or why not?
*
* - A: Yes. Because different animal have different ability to fly. In animal
* class we didn't define how an animal can fly.
*
* - Q: Should the Animal class be abstract? Why or why not?
*
* - A: Yes. Because different animal have different properties. In animal class
* we didn't define how an animal is.
*
* - Q: What kinds of test can you write inside the testAnimal method?
*
* - A: You can write test for the getLegs and canFly methods. Before that, you
* need to inherit the Animal class and override the getLegs and canFly methods.
* Because the Animal class is abstract, you can't create an object of it.
*/
public class Start {
public static void main(String[] args) {
Animal.testAnimal();
}
}