阅读背景:

为什么在尝试从列表中删除元素时,会得到UnsupportedOperationException ?

来源:互联网 

I have this code:

我有这段代码:

public static String SelectRandomFromTemplate(String template,int count) {
   String[] split = template.split("|");
   List<String> list=Arrays.asList(split);
   Random r = new Random();
   while( list.size() > count ) {
      list.remove(r.nextInt(list.size()));
   }
   return StringUtils.join(list, ", ");
}
public static Str



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: