Creates Orc and Troll classes that implement a Monster interface with takeDamage(int amount), String name(), and int currentHitpoints() methods. Creates instances of both classes and stores them in an ArrayList. Iterates through the list and makes each monster take 10 points of damage. After all of the monsters have been damaged, the program reports the name and current hit points of all monsters. Orcs are named “Orc” and have 20 initial hitpoints Trolls are named “Troll”, have 40 hit points and only take half damage
alisonps/hfj-chapter9
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|