arraylist with values code example
Example 1: arraylist with values java
ArrayList cities = new ArrayList<>(Arrays.asList("London", "Tokyo", "New York"));
Example 2: arraylist with values
List x = new ArrayList<>(Arrays.asList("xyz", "abc"));
ArrayList cities = new ArrayList<>(Arrays.asList("London", "Tokyo", "New York"));
List x = new ArrayList<>(Arrays.asList("xyz", "abc"));