摘要: Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.YEAR,3); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); Syste 阅读全文
posted @ 2020-08-19 14:26 辰梓悦 阅读(709) 评论(0) 推荐(0) 编辑
摘要: SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); long time = simpleDateFormat.parse("2020-6-29 9:40").getTime(); long tim 阅读全文
posted @ 2020-06-29 09:51 辰梓悦 阅读(284) 评论(0) 推荐(0) 编辑
摘要: subjects = subjects.stream().collect( Collectors.collectingAndThen( Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(Subjects::getId)) 阅读全文
posted @ 2020-06-22 11:19 辰梓悦 阅读(2237) 评论(0) 推荐(0) 编辑
摘要: Set集合 set不允许包含重复元素 如果将2个相同元素加入同一个Set集合则添加失败 HashSet hashset是按照hash算法来存储集合中的元素具有很好的存取查找功能 hashset具有以下特点 不能保证元素顺序 hashset是线程不安全的 hashset的集合元素可以为null Lin 阅读全文
posted @ 2020-06-21 10:23 辰梓悦 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 集合删除异常 解决方法 Iterator<String> iterator = str.iterator(); while (iterator.hasNext()){ String next = iterator.next(); if(next.equals("1")){ iterator.remo 阅读全文
posted @ 2020-06-20 16:41 辰梓悦 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 默认配置文件application.yml 加入 阅读全文
posted @ 2020-06-07 16:19 辰梓悦 阅读(1605) 评论(0) 推荐(0) 编辑
摘要: SELECT AUTO_INCREMENT FROM information_schema.`TABLES` WHERE Table_Schema= '数据库名'AND table_name ='表名' LIMIT 1; 阅读全文
posted @ 2020-05-19 10:39 辰梓悦 阅读(1958) 评论(0) 推荐(0) 编辑
摘要: File directory = new File("src/main/resources/static/pic"); String courseFile = directory.getCanonicalPath(); System.out.println(courseFile); 资源映射 <re 阅读全文
posted @ 2020-05-13 15:13 辰梓悦 阅读(719) 评论(0) 推荐(0) 编辑
摘要: Objects java7新增的一个工具类 提供一些工具方法来操作对象 这些工具方法大多是"空指针"安全的 比如不能确定一个引用变量是否为null 如果贸然的使用toString方法 可能报空指针异常 但如果使用Objects提供的toSting方法就不会引发异常 只会返回一个"null"字符串 / 阅读全文
posted @ 2020-05-07 08:00 辰梓悦 阅读(110) 评论(0) 推荐(0) 编辑
摘要: System类 Map<String, String> env = System.getenv(); for (String name:env.keySet()){ System.out.println(name + "->" + env.get(name)); } //获取指定环境变量的值 Sys 阅读全文
posted @ 2020-05-07 07:15 辰梓悦 阅读(208) 评论(0) 推荐(0) 编辑