list.set.map.array间的相互转换 list转set Set set = new HashSet(new ArrayList()); set转list List list = new ArrayList(new HashSet()); array转为list List stooges = Arrays.asList("Larry", "Moe", "Curly"); 或者 String[] arr = {"1",…
1.list转set Set set = new HashSet( new ArrayList()); 2.set转list List list = new ArrayList( new HashSet()); 3.数组转为list List stooges = Arrays.asList( "Larry" , "Moe" , "Curly" ); 此时stooges中有有三个元素.注意:此时的list不能进行add操作,否则会报…
1.list转setSet set = new HashSet(new ArrayList()); 2.set转listList list = new ArrayList(new HashSet()); 3.数组转为listList stooges = Arrays.asList("Larry", "Moe", "Curly");或者String[] arr = {"1", "2"};List list =…