Question: Exercise 1: ArrayBag Attached Files: src.zip(1.966 KB For exercise 1, implement the bag interface using an array of well as a class called, ArrayBag that
Exercise 1: ArrayBag Attached Files: src.zip(1.966 KB For exercise 1, implement the bag interface using an array of well as a class called, ArrayBag that implements the interface. All of the "stub members to guide you in your implementation, I've also methods have been created in the ArrayBag class as well as a couple of private created two constructors (that's all that you should need). One constructor will enable the client code that uses ArrayBag to explicitly specify the maximum size of the bag. The second (default) constructor will set the maximum size of the bag to 25. This exercise if due on Monday before class. Please methods, the others will be solved get started on it right away. I gave some examples on the white board that will help you code several of the easil. For the toArray method, follow the example of how to create a new array of type T that was used in the constructor size of the array returned by this method should be the current size of the bag, not it max size. Also, when adding to, and removing from the bag, try to do it as efficiently as possible (as was discussed in class). have to implement the main method located in the Main class but you can certainly use it to test your code, My grader and I will provide our own main method to test your class. Do not alter the used by me or our class' grader. interface, the name of the class, or add any new public methods to your class that are not in the interface; they will not be I will be available to answer your questions until Saturday night; so please get started early. This should not take long to complete
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
