Suppose that groceryBag is an instance of the class Bag which implements BagInterface and is filled with
Fantastic news! We've Found the answer you've been seeking!
Question:
Write some Java statements on the client side that create an array of the distinct strings that are in this bag. That is, if "soup" occurs three times in the groceryBag, it should appear only once in your array.
The final statement is outputting the resulting array. After you finished creating the array, the contents of groceryBag must be unchanged.
.....
import java.util.Scanner; import java.util.Arrays;
package groceryBag;
public class Bag {
add code
public class Bag {
Related Book For
Posted Date: