[转] remove on List created by Arrays.asList throws UnsupportedOperationException

原文地址:https://stackoverflow.com/a/7885607/6091500

1
arrayList = Arrays.asList(list);

替换成

1
arrayList = new ArrayList(Arrays.asList(list));

原因:参见 Arrays.asList 的 JavaDoc。
引用

Returns a fixed-size list backed by the specified array.

坚持原创及高品质技术分享,您的支持将鼓励我继续创作!