数组转集合
List<String> asList = Arrays.asList(arr);
判断数组中的元素是否集合的子集
List<String> list = new ArrayList<>();
list.add("123");
list.add("321");
list.add("111");
System.out.println("list="+list.toString());
String[] arr = new String[]{"111","123"};
boolean b = list.containsAll(Arrays.asList(arr));
System.out.println("判断子集结果:"+b);
控制台结果:
list=[123, 321, 111]
判断子集结果:true