First method : Using ArrayList
ArrayList<String> list = new ArrayList<String>() {{
add("A");
add("B");
add("C");
}};
Second Method : For Java 9 or Later
List<String> strings = List.of("foo", "bar", "baz");
Third Method : For Java 8 or earlier
List<String> strings = Arrays.asList("foo", "bar", "baz");
Fourth Method :
ArrayList<String> list = new ArrayList<String>() {{add("A");add("B");add("C");}};