Why doesn\'t this work?
private List xShot = new ArrayList();
...codes
...codes
...codes
...codes
xSho
xShot.get(0) returns an object; it isn't a variable, so you can't assign to it.
Also, Integer is immutable (you can't change its value), so you would have to replace the object at position 0 with a new Integer that has the calculated value.
You can achieve the intention of that line like this:
xShot.set(0, xShot.get(0) + 5);