04 2017 档案
摘要:本文转自:http://www.cnblogs.com/dolphin0520/p/3920373.html volatile这个关键字可能很多朋友都听说过,或许也都用过。在Java 5之前,它是一个备受争议的关键字,因为在程序中使用它往往会导致出人意料的结果。在Java 5之后,volatile关
阅读全文
摘要:方法1:用while循环和变量实现 方法2:用synchronized、wait、notifyAll实现 static int index = 1; public static void main(String[] args) throws InterruptedException { final
阅读全文

浙公网安备 33010602011771号