数组通过Arrays.asList()转成集合,进行添加操作时报错:UnsupportedOperationException
示例:将Integer数组通过Arrays.asList转成集合,并对该集合List进行添加操作
public static void main(String[] args) {
Integer[] datas = {1,2,3,4,5};
List list = Arrays.asList(datas);
list.add(5);
System.out.println(...
原创
2020-05-02 02:12:48 ·
280 阅读 ·
0 评论