为什么删除对列表而不是数组列表显示错误(UnsupportedOperationException
)?
import java.util.*;
public class learning {
public static void main(String[] args) {
Integer[] array = {2,4,6,8,1,2,3,4};
List<Integer> list = Arrays.asList(array);
System.out.println(list.get(5));
list.remove(4);
System.out.println(list);
output(list);
}
}