摘要:
public class ReentrantDemo { //重入锁 保护临界区资源count,确保多线程对count操作的安全性 /*public static ReentrantLock rtlock = new ReentrantLock(); public static int count = 0; Thread t = new Thread(new Ru... 阅读全文
2019年3月20日 #
摘要:
public class InternDemo { public static void main(String[] args){ /* jdk7版本之后 字符串常量池从Perm Space移到Java Heap */ //生成两个对象 String s1 = new String("aaa"); ... 阅读全文