To use ArrayList, you first import it from java.util:
import java.util.ArrayList;
Then create one with the new keyword:
ArrayList<String> names = new ArrayList<>();
The angle brackets <String> tell Java what type of object the list holds. The empty <> on the right side is the diamond operator. Java infers the type from the left side, so you do not repeat it.
Unlike arrays, you do not specify a size. The list starts empty and grows as you add elements. You can optionally pass an initial capacity like new ArrayList<>(20), but the list still starts with zero elements.