Tuesday, September 14, 2004 04:26 AM
The implementation of Arrays do not create a java.util.ArrayList as a result of the method java.util.Arrays.asList(Object obj), Instead the result is kind of a readonly list
The API says "Returns a fixed-size list backed by the specified array...", obj parameter "the array by which the list will be backed.".
meaning that the returned list is a readonly list.
Use a java.util.ArrayList(Collection c) by using:
List newList = new java.util.ArrayList(Arrays.asList(myList));