Set转换为List的方法:
Set<String> set = new HashSet<String>();List<String> list = new ArrayList<String>(set);List转换为Set的方法:
List<String> list = new ArrayList<String>();Set<String> set = new HashSet<String>(list);Set和List的区别:Set中的元素不可以重复,List的元素可以重复,转换过程中有可能会丢失数据
List 集合内容按首字母排序的方法:
Collections.sort(list);集合元素的类型不能是基本数据类型
新闻热点
疑难解答