how to initialize arraylist at time of declaration 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
));