I have an Arraylist of integers. My requirement is to determine if the arraylist HAS an element existing at the specified index.If YES, then a value should be set to that in
What you want is a Map rather than a List.
Map
List
What if counter is way bigger then List.size()? Do you add as many elements as needed in between?
counter
List.size()