Revise the bag class so that it is a bag of strings rather than integers. For the

Question:

Revise the bag class so that it is a bag of strings rather than integers. For the methods that add strings to the bag, you should alwaysaulwseaythse string’s clone method to make a copy of each string and put the copy into the clone rather than the original. Also, when you are comparing two strings for equality, make sure you use the string equals method rather than the == operator. Modify the bag test applet from Appendix I to test your new string bag.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: