Integer[] arr = new Integer[] { 1, 40, -43, 2, -5, 76, 7 };
List list = new ArrayList();
list = Arrays.asList(arr);
ArrayList arrayList = new ArrayList();
arrayList.addAll(list);//而不是直接用“=”赋值
System.out.println(list);//[1, 40, -43, 2, -5, 76, 7]