会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
辰梓悦
博客园
首页
新随笔
联系
订阅
管理
2020年8月19日
Java 获取UTC时间
摘要: 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 辰梓悦
阅读(727)
评论(0)
推荐(0)
2020年6月29日
Java计算时间差
摘要: 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 辰梓悦
阅读(299)
评论(0)
推荐(0)
2020年6月22日
Java8根据某字段去重
摘要: subjects = subjects.stream().collect( Collectors.collectingAndThen( Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(Subjects::getId))
阅读全文
posted @ 2020-06-22 11:19 辰梓悦
阅读(2244)
评论(0)
推荐(0)
2020年6月21日
集合
摘要: Set集合 set不允许包含重复元素 如果将2个相同元素加入同一个Set集合则添加失败 HashSet hashset是按照hash算法来存储集合中的元素具有很好的存取查找功能 hashset具有以下特点 不能保证元素顺序 hashset是线程不安全的 hashset的集合元素可以为null Lin
阅读全文
posted @ 2020-06-21 10:23 辰梓悦
阅读(122)
评论(0)
推荐(0)
2020年6月20日
java.util.ConcurrentModificationException
摘要: 集合删除异常 解决方法 Iterator<String> iterator = str.iterator(); while (iterator.hasNext()){ String next = iterator.next(); if(next.equals("1")){ iterator.remo
阅读全文
posted @ 2020-06-20 16:41 辰梓悦
阅读(138)
评论(0)
推荐(0)
2020年6月7日
Springboot引入多个配置文件
摘要: 默认配置文件application.yml 加入
阅读全文
posted @ 2020-06-07 16:19 辰梓悦
阅读(1620)
评论(0)
推荐(0)
2020年5月19日
Mysql获取下一条自增主键的值
摘要: SELECT AUTO_INCREMENT FROM information_schema.`TABLES` WHERE Table_Schema= '数据库名'AND table_name ='表名' LIMIT 1;
阅读全文
posted @ 2020-05-19 10:39 辰梓悦
阅读(1977)
评论(0)
推荐(0)
2020年5月13日
Springboot 打成jar获取不到static文件图片
摘要: File directory = new File("src/main/resources/static/pic"); String courseFile = directory.getCanonicalPath(); System.out.println(courseFile); 资源映射 <re
阅读全文
posted @ 2020-05-13 15:13 辰梓悦
阅读(728)
评论(0)
推荐(0)
2020年5月7日
常用类
摘要: 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 辰梓悦
阅读(214)
评论(0)
推荐(0)
下一页
公告
点击右上角即可分享