Here's a simple integer array.
int[] intArray = new int[5];
Now I make the first element equal to a variable.
a = 10;
intArray[0] = a;
How can I change the variable so the array automatically updates without using referring to the array?
E.g.
a = 10;
intArray[0] = a;
a = 15;
// If intArray was referencing 'a' then wouldn't it automatically update?
// Don't want to have to explicitly type "intArray[0] = 15"
Can this be done with arrays or lists?