Why do I get an UnsupportedOperationException when trying to remove an element from a List?

后端 未结 17 2249
后悔当初
后悔当初 2020-11-22 07:43

I have this code:

public static String SelectRandomFromTemplate(String template,int count) {
   String[] split = template.split(\"|\");
   List         


        
17条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-22 07:54

    Arraylist narraylist=Arrays.asList(); // Returns immutable arraylist To make it mutable solution would be: Arraylist narraylist=new ArrayList(Arrays.asList());

提交回复
热议问题