- 博客(4)
- 资源 (1)
- 收藏
- 关注
原创 HashMap源码 - put操作
final V putVal(int hash, K key, V value, boolean onlyIfAbsent, boolean evict) { Node<K,V>[] tab; Node<K,V> p; // 总是指向某个桶的链表的头节点 int n, i; // tables为null,或者长度为0(即数组未初始化时),进行扩容 if ((tab = table) == null ||
2022-05-27 15:40:19
112
原创 SpringAop-@DeclareParents的作用
@DeclareParents的作用@DeclareParents是SpringAOP提供的一种功能,允许我们在代理目标类上增加新的行为,即新的方法。例子:先有代理类:ICar接口package com.liuquanju.aop.dao.car;/** * @Description 汽车接口 * @Date 下午3:50 2022/5/22 **/public interface ICar { /** * @Author yingjie.liu * @D
2022-05-24 00:05:45
297
原创 springboot使用nacos作为配置中心
1.引入依赖<dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId></dependency>2.类路径下创建:bootstrap.properties,配置:spring.application.name=liuquanjuamll-c
2020-11-15 17:50:36
456
原创 详细的单例模式的八种写法
浅谈单例模式最近在学设计模式,感受颇深,闲来无聊,记录一下单例模式的学习。单例模式:采取一定的保证在整个热案件系统中,对一个类只能存在一个对象实例,且只提供一个能取得对象实例的静态方法。单例模式的八种方式:1)饿汉式(静态常量)2)饿汉式(静态代码块)3)懒汉式(线程不安全)4)懒汉式(线程安全,同步代码块)5)懒汉式(线程线程安全,同步方法)6)双重检查7)静态内部类8)...
2019-12-15 01:55:19
374
designer_pattern.rar
2019-12-15
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人