I've noticed Java has a lot of collection types and I am unsure which one to use. I come from a Swift programming background. What is the closest or equivalent Java collection to a Swift array? From my research, ArrayList, seems to be the closest. I just want to confirm this.
List interface in Java does expose functionalities similar to the Swift Array struct.
There are several Java implementation of List:
Each one is particularly optimised for some kind of task so you should pick the one that better fits your need.
ArrayList is probably the most commonly used.
Please keep in mind that the previous list is about Java classes while the Swift Array is a struct. There are important differences (reference type vs value type) about how these 2 types behave.