java多线程同步案例
文章平均质量分 77
cc550183
这个作者很懒,什么都没留下…
展开
-
java多线程同步案列---按照固定格式输出数字和字母
/*2. 三个线程 1个线程从1~26输出 1个线程从a~z输出 1个线程从A~Z输出 输出格式为: 1 a A 2 b B 3 c C 4 d D ... 26 z Z*/ //首先创建一个公用类PrintAll public class PrintAll { int all = 1;//定义一个属性all //创建打印数字的方法原创 2016-03-24 01:08:20 · 685 阅读 · 0 评论 -
java多线程同步案例之--生产者消费者模型
//定义一个仓库类 public class Storage { /** * Max_num表示仓库的最大容量 * cur_num表示当前仓库的库存 */ static int Max_num = 100; private int cur_num = 50; //入库的方法 publ原创 2016-03-24 00:51:50 · 422 阅读 · 0 评论