If you need a read-only List
List<String> numbers = Arrays.asList("one","two","three");
// Can't add since the list is immutable
numbers.add("four"); // java.lang.UnsupportedOperationException
If you would like to modify the List
later on.
List<String> numbers2 = new ArrayList<String>(
Arrays.asList("one","two","three"));
numbers2.add("four");
System.out.println(numbers2); // [one, two, three, four]