Run ❯
Get your
own Java
server
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
import java.util.ArrayList; public class Main { public static void main(String[] args) { ArrayList
list = new ArrayList
(); list.ensureCapacity(15); for (int i = 1; i <= 15; i++) { list.add(i); } System.out.println(list); } }
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]