How do I create a new list that contains multiple integers? thanks!
A line of code would also be greatly apreciated.


int[] integerArray = new int[5]; // an empty array that could store 5 ints int[] anotherArray = new int[]{ 1, 2, 10, 42 }; // an array with 4 specified elements // example usage: integerArray[0] = 5*7; integerArray[1] = 2 *integerArray[0]; integerArray[2] = 10 -anotherArray[2];
List<Integer> integerList = new ArrayList<Integer>(); // example usage: integerList.add(5); // if I'm correct, the 5 will automatically be 'interpreted' as new Integer(5) integerList.add(99); int firstValue = integerList.get(0).intValue();
import java.util.List; import java.util.ArrayList;