package com.ii11;
public class ThreadDemo2 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
TestThread t = new TestThread();
new Thread(t).start();
for(int i=0; i<3; i++)
{
System.out.println("main 线程在运行");
}
}
}
class TestThread implements Runnable
{
public void run()
{
for(int i=0; i<3; i++)
System.out.println("Thread 线程在运行");
}
}
没有实现多线程效果,只显示如下结果为何
main 线程在运行
main 线程在运行
main 线程在运行
Thread 线程在运行
Thread 线程在运行
Thread 线程在运行