arraylist with values

Java
List<String> x = new ArrayList<>(Arrays.asList("xyz", "abc"));
Source

Also in Java: