摘要: 1、Java线程的实现。 第一种方式可以通过继承Thread。在Thread类中,有许多关于线程操作的方法,比如:sleep();activeCount();等 继承Thread的代码:public class MyThread extends Thread{ public static void main(String[] args) { MyThread myth = new MyThread(); MyThread myth1 = new MyThread(); myth.start();//启动一个线程 myth1.start(... 阅读全文
posted @ 2014-03-06 10:54 liutoutou 阅读(184) 评论(0) 推荐(0) 编辑