Here is an example:
public static ArrayList<Integer> position = new ArrayList<Integer>();
public static ArrayList<Integer> new_position = new ArrayList<Integer>();
Collections.copy(new_position, position);
for (int j = 0; j < position.size(); j++) {
new_position.get(j) -=4;
}
I want to copy values and then from my new arraylist subtract 4. How can I make it ?
I'm new in java. Also I've got an error such as: The left-hand side of an assignment must be a variable, it refers to nowe_pozycje.get(j) -=4;.
ArrayListis not an array.subtract 4means? what exactly you want to do? do you want to remove 4 elements?