Sorry. I mess up with putting the println you gave me earlier in the wrong method. Here is the correct one.
"add() mC= []
add() mC= [SKU 1234-0: 500]
add() mC= [SKU 1234-0: 500, SKU 1234-1: 25]...
Type: Posts; User: maple1100
Sorry. I mess up with putting the println you gave me earlier in the wrong method. Here is the correct one.
"add() mC= []
add() mC= [SKU 1234-0: 500]
add() mC= [SKU 1234-0: 500, SKU 1234-1: 25]...
"add() mC= [SKU 1234-0: 500, SKU 1234-1: 25, SKU 1234-2: 7720]
add() mC= [SKU 1234-0: 500, SKU 1234-1: 25, SKU 1234-2: 7720]
add() mC= [SKU 1234-0: 500, SKU 1234-1: 25, SKU 1234-2: 7720]
add() mC=...
Thanks for the help yesterday, Norm. I managed to change the code to print out 3 different song for Bin A but it is using the first song from Bin A for Bin B instead of another random song. I believe...
Sorry to keep bothering you ,Norm. But after modifying my code with what I know, I still can't get it to print 3 song for Bin A instead of 1 song. May I get some more hints? Thanks
The direction I...
I tested it and the catalog.get() is working fine but it seem the warehouse arraylist only have the size of 2 for some reason. Could you check in the Bin class if I wrote the methods to add to...
I edited the code a little and here is the new code
import java.util.*;
public class Media
{
public static ArrayList<MusicMedia> MakeMusicCatalog(int size)
{
...
"b.getContents().get(i)" is causing the error because only 4 ArrayList is created but the for loop is calling for < catalog.size() which is 10.
That what I was thinking too. Since the size of warehouse is only 4, the maximum index would be 3. I figured the error is at "for(Bin b : warehouse)" since warehouse is 4 and it would result in the...
Could someone help me with fixing this indexoutofbound error? The error is occuring at
"s += catalog.get(i).toString() + "," + catalog.get(i).getSKU() + ": " + b.getContents().get(i)+ "\n" ;"
...