Question: The World class has an attribute named creatures, which is an ArrayList of objects of type Creature. The Creature, Wizard and Warrior classes have the
The World class has an attribute named creatures, which is an ArrayList of objects of type Creature. The Creature, Wizard and Warrior classes have the attributes as well as the getter and setter methods you designed in Problem 1. Write a method, for the World class, named findPowerfulWizards that receives one parameter (a number of potions), and creates and returns a new ArrayList of Wizard objects containing only those wizards whose number of potions is larger than the parameter. (For partial credit, have your method just find and return the number of wizards whose number of potions is more than the parameter.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
