摘要: 1.错误的代码package org.lkl.thead.sync;public class ThreadSynchronized { class Outputter{ public void output(String name){ for(int i =... 阅读全文
posted @ 2014-06-05 18:58 廖凯林 阅读(742) 评论(0) 推荐(1) 编辑
摘要: 案例1间隔1秒以后执行task任务package org.lkl.timer;import java.util.Date;import java.util.Timer;import java.util.TimerTask;public class TimerFoo { public stati... 阅读全文
posted @ 2014-06-05 18:16 廖凯林 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 线程的两种实现方式 继承Thread类Thread thread = new Thread(){ @Override public void run() { while(true){ try { Thread.sleep(500); } catch (In... 阅读全文
posted @ 2014-06-05 17:36 廖凯林 阅读(342) 评论(0) 推荐(0) 编辑