I need to add an outside number to EVERY number in an ArrayList. I've looked for 2 days trying to find a similar answer and found nothing.
ArrayList<Integer> list = new ArrayList<Integer>();
list.add(12);
list.add(45);
list.add(23);
list.add(47);
list.add(13);
public static void modifyList(ArrayList<Integer> theList, int value)
{
for (int i = 0; i < theList.size(); i++)
{
theList.add(theList[i],value);
}
}
I've tried various combinations of the add feature for ArrayList but there is always a different error and i'm starting to go crazy