Question: Create a new Java project called usernamePart3 in Netbeans. Select the option to create a main method. Create a new class called Flower. Create a
Create a new Java project called usernamePart3 in Netbeans. Select the option to create a main method. Create a new class called Flower. Create a second new class called Plant. Rewrite your code from Part2 so that: The Plant class is abstract Flower extends Plant The Plant class contains at least 2 abstract methods All methods, constructors and instance variables that were in the Flower and Plant classes in part 2 must be included in part 3. You need to rewrite the Flower and Plant classes from part 2 so that Plant is abstract and there are multiple ways to create a Flower. In the main method of your project write the code to: Declare an HashSet with a type parameter of Flower Add at least 3 Flowers to the HashSet Use an Iterator (java.util.Iterator) to loop through the Flowers in the HashSet (must use the hasNext() and next() methods) Check if the HashSet contains a particular Flower Remove a Flower from the HashSet Print the size of the HashSet Clear the HashSet
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
