日期:2014-05-20 浏览次数:20806 次
public class ThreadDemo_3
{
public static void main(String[] args)
{
TestThread a1 = new TestThread();
Thread a = new Thread(a1);
a.start();
while(true)
{
System.out.println("main thread is running");
}
}
}
class TestThread implements Runnable
{
public void run()
{
while (true)
{
System.out.println(Thread.currentThread().getName()+"is running~~");
}
}
}