I am trying to remove an item of a List
.
list.remove(key);
However, it throws an exception:
Caused by: java.lang.UnsupportedOperationException
at java.util.AbstractList.remove(AbstractList.java:161)
at java.util.AbstractList$Itr.remove(AbstractList.java:374)
at java.util.AbstractCollection.remove(AbstractCollection.java:293)
at bean.Bean.deleteRow(Bean.java:46)
How is this caused and how can I solve it?
问题是在用于初始化列表的Arrays.asList()期间,通过使用list.add(String)我解决了问题
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.