List aList = new List (); // 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)