4 lines
265 B
Text
4 lines
265 B
Text
List <Integer> aList = new List <Integer>(); // optionally add an initial size as an argument
|
|
aList.add(5);// appends to the end of the list
|
|
aList.add(1, 6);// assigns the element at index 1
|
|
System.debug(list[0]); // Prints 5, alternatively you can use list.get(0)
|