上一页 1 2 3 4 5 6 7 ··· 40 下一页
该文被密码保护。 阅读全文
posted @ 2017-12-03 13:23 黑土白云 阅读(1) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2017-12-03 12:58 黑土白云 阅读(1) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2017-12-03 10:59 黑土白云 阅读(1) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2017-12-03 10:22 黑土白云 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 1. 懒汉双重检验 1 public class DubbleSingleton { 2 3 private static DubbleSingleton ds; 4 5 public static DubbleSingleton getDs(){ 6 if(ds == null){ 7 try { 阅读全文
posted @ 2017-12-02 10:09 黑土白云 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 1. 1 public class ConnThreadLocal { 2 3 //线程变量副本,每个线程都有一个,所以多线程的时候,就不会出现覆盖.而是每个线程一个 4 public static ThreadLocal<String> th = new ThreadLocal<String>() 阅读全文
posted @ 2017-12-02 10:05 黑土白云 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 1. 阅读全文
posted @ 2017-12-01 22:37 黑土白云 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 1. final List<String> synchronizedList = Collections.synchronizedList(tickets);//list变成线程安全的 1 public class Tickets { 2 public static void main(String 阅读全文
posted @ 2017-12-01 22:10 黑土白云 阅读(274) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2017-12-01 22:04 黑土白云 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 1. 1 public class ListAdd2 { 2 private volatile static List list = new ArrayList(); 3 4 public void add(){ 5 list.add("hello"); 6 } 7 8 public int siz 阅读全文
posted @ 2017-12-01 22:00 黑土白云 阅读(412) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 40 下一页