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
int counter = 0; for(int x : copyArray) { x /= 2; copyArray[counter++] = x; }
Your program just modified the value of variable x , not the values within the blocks of array copyArray
x
copyArray