add a value to list while initializing java code example
Example 1: java instantiate collection with values
List<Integer> integerArray = Arrays.asList(2, 41, 42, 48);
Example 2: initialize arraylist
ArrayList<Type> list = new ArrayList<Type>(Arrays.asList(
elem1, elem2,..., elemN
));