The Class BagOfStrings So Far
In this lesson, we will collect the constructor and method definitions into a class and test it.
We'll cover the following...
We'll cover the following...
The class and a client
The following program shows the definition of the class BagOfStrings at this point in its development. It contains only the data fields, constructors, and core methods that we have seen earlier. Before we continue the implementation of this class, we will test the class using the method main in the class BagDemo1, which is also in the code given below. Click the RUN button.
After running the previous program, you should get the following output:
Adding to an empty bag: A, A, B, A, C, A The bag contains A A B A C A This bag is not full. Adding to an empty bag: A, B, A, C, B, C, D The bag contains A B A...