I\'m learning Java on my own; and therefore the code below has no function other than for learning/testing.
Essentially I\'m trying to modify the elements of an Inte
You can't do that in a foreach loop.
for (int i=0; i
Else you are not assigning it back into the array. Integer objects are immutable by the way so can't modify them (creating new ones though).
Updated from comment: Beware though that there are a few things going on, autoboxing/unboxing for example, roughly:
copyArray[i] = Integer.valueOf(copyArray[i].intValue()/2);