
JAVA
Aengus the GOD
这个作者很懒,什么都没留下…
展开
-
fastjson反序列化接口字段为null
先看一个例子Packet类,其中的IPlayMessage字段为接口@Data@AllArgsConstructor@NoArgsConstructorpublic class Packet { private int packetNo; private Date date; private IPlayMessage message;}IPlayMessage接口public interface IPlayMessage {}PositionMessage实现类原创 2022-03-23 21:11:48 · 2030 阅读 · 0 评论 -
Spring Boot热部署
使用devtools实现热部署IDEA版本:2021.2.41.在pom.xml中添加依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</sc原创 2022-02-23 21:07:08 · 141 阅读 · 0 评论 -
HashMap resize()
final Node<K,V>[] resize() { Node<K,V>[] oldTab = table; int oldCap = (oldTab == null) ? 0 : oldTab.length; int oldThr = threshold; int newCap, newThr = 0; if (oldCap > 0) { if (oldCap...原创 2021-05-25 16:35:32 · 155 阅读 · 0 评论 -
关于CMS和G1垃圾收集器浮动垃圾及重新标记的看法
可达性分析使用的是三色标记法。参考博文https://javap.blog.youkuaiyun.com/article/details/109558171?utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-1.baidujs&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blo.原创 2021-05-08 17:12:42 · 1780 阅读 · 0 评论 -
关于重写equals()方法和hashCode()方法
新建一个Student类,重写equals()方法和hashCode()方法class Student { String name; int ID; public Student() {} public Student(String name, int ID) { this.name = name; this.ID = ID; } @Override public boolean equals(Object o) { if (this == .原创 2021-05-07 21:11:09 · 389 阅读 · 0 评论 -
String源码解读
1.String为什么要用final修饰public final class String implements java.io.Serializable, Comparable<String>, CharSequence final表明String类不可被继承,是为了String的安全性,在jvm内存中,字符串被存储在堆中的字符串常量池(StringTable)中,对于相同的字符串,StringTable中只存一份,若String不用final修饰的话,任意一个引用对Stri原创 2021-04-29 16:57:40 · 249 阅读 · 0 评论