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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!