1.数组转List集合
Integer[] a = {1,2,3};
List<Integer> collect =
Arrays.stream(a).collect(Collectors.toList());
if (collect.contains(1)){
System.out.println("正确");
}
2.List集合转数组
List<Integer> list = Arrays.asList(1,2,3,4);
System.out.println(list);
Object[] array = list.toArray();
System.out.println(Arrays.toString(array));