assign value to list at declartion java code example
Example: arraylist with values java
ArrayList<String> cities = new ArrayList<>(Arrays.asList("London", "Tokyo", "New York"));
ArrayList<String> cities = new ArrayList<>(Arrays.asList("London", "Tokyo", "New York"));