The printout should show what is in the list AFTER the item is added.
The printouts show that three items were added to one bin and one item was added to the other.
Then the getContents() method...
Type: Posts; User: Norm
The printout should show what is in the list AFTER the item is added.
The printouts show that three items were added to one bin and one item was added to the other.
Then the getContents() method...
That looks like the same thing is being added to the llist three times. Is that correct? Which Bin is it being added to?
This print out shows the list as always having 3 items in it? How...
What is printed out by the println statements you are using for debugging? Call println every time something is added to Bin A and Bin B to see what is placed in each bin.
Continue debugging the code by adding more printlns. If you print out the contents of the arraylists every time you add something to the arraylist, what is printed out will show you what is in the...
You can do that by adding some calls to the println() method to print out the contents of the ArrayList every time something is added to it. For example, Add this to the add() method and the...
Try debugging the code by adding printlns that print out the contents of the collections and variables so you can see what the computer sees when it executes the program.
Print the contents of Bin...
It doesn't make sense to use a index that is past the end. The code needs to be changed so the index does not go past the end.
Which get() is causing the error? Look at the size of the collections connected to the get() methods being called.
If the array has a size of 1 then the maximum index is 0.
Check the logic to make sure the index does not go past the array length-1