06 2013 档案

摘要:线程的实现有两种方式,一种是继承Thread类,一种是实现Runnable接口。1.使用继承Thread方法实现多线程。 1 public class MyThread extends Thread{ 2 private int time; //线程的休眠时间 3 public MyThread(String name,int time){ 4 super(name); //设置线程名称 5 this.time = time;//设置线程时间 6 } 7 public voi... 阅读全文
posted @ 2013-06-16 02:57 寻找venus 阅读(170) 评论(0) 推荐(1)