You can only use the notation for an array index on an array. When you do list[i], it is only allowed if list is an array, and list is a java.util.ArrayList according to your error message. Even with its suggestive name, java.util.ArrayList is not a kind of array.
Fortunately, ArrayList has the get method which does for lists what [i] does for arrays. Just call list.get(i) in place of list[i]. If this were C++ the  operator would probably be overridden by ArrayList, but in Java that's not possible so we do the best we can with a get method. You will notice something similar when you try to use java.math.BigInteger.