//通过继承Thread类实现多线程
package 多线程;
class TestThread extends Thread
{
public void run()
{
for(int i = 0 ; i < 10 ; i++)
{
System.out.println("TestThread在运行");
}
}
}
public class ThreadDemo_01 {
public static void main(String[] args) {
new TestThread().start();
//循环输出
for(int i = 0 ; i < 10 ; i++)
{
System.out.println("main线程在运行");
}
}
}