Java线程入门
摘要:
一、继承Thread:示例:public class my extends Thread{ public void run(){}; public static void main(String[] args){ my t=new my(); t.start(); }}二、实现Runnable接口:要定义一个Thread,并且重载start方法:public class my implements Runnable{ Thread t=null;public my() { t=new Thread(this); t.start();} public void run() { System.ou 阅读全文
posted @ 2011-12-08 20:25 巨富一生 阅读(132) 评论(0) 推荐(0) 编辑