1.数组--->List
String[] ss={"abc","def","xyz","aaaaaaaa","bbbb","abc"}; Listlist=new ArrayList (Arrays.asList(ss));//按添加顺序显示System.out.println("list---->"+list); //list---->[abc, def, xyz, aaaaaaaa, bbbb, abc]
2.数组--->Set
String[] ss={"abc","def","xyz","aaaaaaaa","bbbb","abc"}; Setset=new TreeSet (Arrays.asList(ss));;//TreeSet有排序去重功能System.out.println("set---->"+set); //set---->[aaaaaaaa, abc, bbbb, def, xyz]