1. Create a project with a common package and three files, separating interface from implementation and use. One of your files will be hosting the Main class which you can use to test and debug your project. 2. Implement the given BagInterface in a class VectorBag. This class will not have a static size (n), but you will allow it to grow dynamically. Recall that we collect arbitrary objects, so you need to use Vector instead of Object[] as we did in lecture. The length of a vector is tested with the size() method. To add elements, use the add() method. To remove an element from a vector, use the remove() method. It seamlessly adjusts entries, so you do not need to move subsequent items. 3. Test and debug your project.
1. Create a project with a common package and three files, separating interface from implementation and use. One of your files will be hosting the Main class which you can use to test and debug your project.
2. Implement the given BagInterface in a class VectorBag. This class will not have a static size (n), but you will allow it to grow dynamically. Recall that we collect arbitrary objects, so you need to use
3. Test and debug your project.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 7 images