MyThread mt=new MyThread();
new Thread(mt).start();
while(true)...{
System.out.println("main:"+Thread.currentThread().getName());
}
}
}
class MyThread implements Runnable...{ //实现Runnable接口
public void run()...{
while(true)...{
System.out.println(Thread.currentThread().getName());
}
}
}

