摘要: TreeSet的比较器只有在泛型类型为系统定义好的数据类型时,才有给定的比较器,且默认为升序,其余情况均要通过处理。 1.TreeSet的降序排序实现: 此时需要我们重写Comparator的接口 代码实现: 1 public static void TreeSetDesc()//实现降序 2 { 阅读全文
posted @ 2022-03-25 20:56 jue1e0 阅读(115) 评论(0) 推荐(0)
摘要: Set的主要特性:Set集合中不能存在两个相同的元素 1.Set的常用函数:与Collection的常用函数和名称完全相同。 2.HashSet即为Set的主要实现类 1 public static void HashSetTest() 2 { 3 HashSet set = new HashSet 阅读全文
posted @ 2022-03-25 20:28 jue1e0 阅读(558) 评论(0) 推荐(0)
摘要: 1.创建File类的常用方法: 1 /* 1.创建file类的实例 2 * File(String filePath) 3 * File(String parentPath,String childPath) 4 * File(File parentFile,String childPath) 5 阅读全文
posted @ 2022-03-25 08:17 jue1e0 阅读(41) 评论(0) 推荐(0)