Character[] arr={'a','b','1','d','c'};
ArrayList<Character> list=new ArrayList<Character>();
list.add('d');
Collections.addAll(list, arr);
System.out.println(list.toString());//[d, a, b, 1, d, c]
TreeSet set=new TreeSet<>();
set.add('d');
Collections.addAll(set, arr);
System.out.println(set.toString());//[1, a, b, c, d]
集合类的有序
最新推荐文章于 2024-05-06 23:58:20 发布
1248

被折叠的 条评论
为什么被折叠?



