/**
* pTitle: 实现Runnable接口,获得线程。/p
* pDescription: 通过实现Runnable接口来获得自己的线程(t2)。/p
* pCopyright: Copyright (c) 2003/p
* pFilename: twothread.java/p
* @version 1.0
*/
public class twothread implements Runnable {
/**
*br方法说明:构造器。实际线程,并启动这个线程。
*br输入参数:
*br返回类型:
*/
twothread() {
//获取当前的线程
Thread t1 =Thread.currentThread();
t1.setName("The first main thread");
System.out.println("The running thread:" + t1);
//通过将本类(Runnable接口)和名称构造一个线程
Thread t2 = ...[ 查看全文 ]