介绍 注解(也被称为元数据)为我们在代码中添加信息提供了一种形式化的方法,使我们可以在稍后某个时刻非常方便地使用这些数据。 java.lang中内置注解: @Override:表示当前的方法定义将覆盖超类中的方法。如果你不小心拼写错误,或者方法签名对不上覆盖的方法,编译器就会发出错误提示。 @Dep ...
分类:
编程语言 时间:
2020-10-18 09:35:17
阅读次数:
22
虽然我们都知道有20多个设计模式,但是大多停留在概念层面,真实开发中很少遇到,Mybatis源码中使用了大量的设计模式,阅读源码并观察设计模式在其中的应用,能够更深入的理解设计模式。 Mybatis至少遇到了以下的设计模式的使用: Builder模式,例如SqlSessionFactoryBuild ...
分类:
其他好文 时间:
2020-10-08 19:17:18
阅读次数:
14
注意: 总人数少于1100人。 示例 输入: [[7,0], [4,4], [7,1], [5,0], [6,1], [5,2]] 输出: [[5,0], [7,0], [5,2], [6,1], [4,4], [7,1]] public static void main(String[] args ...
分类:
编程语言 时间:
2020-10-06 20:40:36
阅读次数:
25
java 服务端测试代码: @Override public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception { buffer.writeShort(5); buff ...
分类:
编程语言 时间:
2020-10-05 21:23:34
阅读次数:
42
CountDownLatch 是一个同步工具,允许一个或多个线程 等待其他线程(一个或多个线程)完成一组操做。 CountDownLatch 中的方法不多: public CountDownLatch(int count) 构造方法 count 是同步计数的初始值 public void count ...
分类:
其他好文 时间:
2020-09-18 02:39:54
阅读次数:
43
主要三步: 1、state方法中混入with AutomaticKeepAliveClientMixin 2、继续在state方法中的build方法中添加super.build(context); 3、继续在state方法中添加 1 @override 2 // TODO: implement wa ...
分类:
其他好文 时间:
2020-09-18 02:17:18
阅读次数:
41
1、线程状态 Thread.State public enum State { /** * Thread state for a thread which has not yet started. */ NEW,(新建) /** * Thread state for a runnable threa ...
分类:
编程语言 时间:
2020-09-18 00:09:42
阅读次数:
28
package club.interview.algorithm.print; import io.netty.util.concurrent.DefaultThreadFactory; import java.util.concurrent.*; /** * 多线程打印 * -- 2个线程交替打印 ...
分类:
编程语言 时间:
2020-09-17 19:59:50
阅读次数:
38
一、单个Spring Boot应用使用CorsConfig配置类,实现WebMvcConfigurer解决跨域问题 import org.springframework.context.annotation.Configuration; import org.springframework.web. ...
分类:
其他好文 时间:
2020-09-17 19:05:01
阅读次数:
35
This锁和Class锁 This锁 接下来代码理解一下This锁: /** * @program: ThreadDemo * @description: This锁的实验 * @author: hs96.cn@Gmail.com * @create: 2020-09-06 */ public cl ...
分类:
其他好文 时间:
2020-09-17 16:11:06
阅读次数:
19