Question: Implement a class Bag that stores items represented as strings. Items can be repeated. Supply methods for adding an item, and for counting how many
Implement a class Bag that stores items represented as strings. Items can be repeated. Supply methods for adding an item, and for counting how many times an item has been added: public void add(String itemName) public int count(String itemName) Your Bag class should store the data in an ArrayList
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
