摘要:
温故知新,接下来看看线程池。 同时启动3个线程A、B、C,A线程输出A 20次,B线程输出B 20次,C线程输出C 20次,要求输出结果为顺序输出A、B、C、A、B、C。。。Java代码class Agent{ publicstaticint state = 1; publicsynchronizedvoid sayA() { if(state != 1){ try { super.wait(); } catch (Exception e) { // TODO: handle exception } } System.out.println("A"); sta... 阅读全文
posted @ 2012-08-17 10:47 乀閉丄眼﹋ 阅读(234) 评论(0) 推荐(0)
浙公网安备 33010602011771号