how to initialize arraylist with default values in java code example
Example 1: arraylist with values
List<String> x = new ArrayList<>(Arrays.asList("xyz", "abc"));
Example 2: initialize arraylist
ArrayList<Type> list = new ArrayList<Type>(Arrays.asList(
elem1, elem2,..., elemN
));
Example 3: java arraylist initialize with 0
List<Integer> list = new ArrayList<Integer>(Collections.nCopies(60, 0));
Example 4: java initalize arraylist
List<Type> list = Arrays.asList(elem1, elem2,..., elemN);