4 lines
227 B
Java
4 lines
227 B
Java
ArrayList <Integer> list = new ArrayList <Integer>();//optionally add an initial size as an argument
|
|
list.add(5);//appends to the end of the list
|
|
list.add(1, 6);//assigns the element at index 1
|
|
System.out.println(list.get(0));
|