02 2023 档案

摘要:时间戳与格式日期时间转换 1.使用LocalDateTime:线程安全 public void testLocalDateTime() { long time = new Date().getTime(); DateTimeFormatter dtf = DateTimeFormatter.ofPa 阅读全文
posted @ 2023-02-15 15:22 musecho 阅读(302) 评论(0) 推荐(0)
摘要:源自:https://docs.spring.io/spring-framework/docs/5.2.12.RELEASE/spring-framework-reference/core.html#beans-setter-injection Dependencies Injection Spri 阅读全文
posted @ 2023-02-13 17:24 musecho 阅读(36) 评论(0) 推荐(0)
摘要:静态代码块、构造代码块、构造方法、@Autowired、@PostConstruct 执行顺序 执行顺序: 1、父类静态变量和静态代码块(先声明的先执行); 2、子类静态变量和静态代码块(先声明的先执行); 3、父类的变量和代码块(先声明的先执行); 4、父类的构造方法; 5、子类的变量和代码块(先 阅读全文
posted @ 2023-02-13 17:24 musecho 阅读(544) 评论(0) 推荐(0)
摘要:Spring官网推荐使用构造器注入和setter注入:https://docs.spring.io/spring-framework/docs/5.2.12.RELEASE/spring-framework-reference/core.html#spring-core 1.通过@Autowired 阅读全文
posted @ 2023-02-10 14:52 musecho 阅读(771) 评论(0) 推荐(0)