java.lang.UnsupportedOperationException at java.util.AbstractList.remove(Unknown Source)

Easy work around is just to pass in the List into an ArrayList‘s constructor.

For example:

String valuesInArray[]={"1","2","3","4"};  
List modifiableList = new ArrayList(Arrays.asList(valuesInArray));
System.out.println(modifiableList.remove("1") + "  remove flag");  
System.out.println(" collcetion "+ modifiableList); 

Response:

true remove flag

collcetion [2, 3, 4]

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)