import java.util.*;
public class ThreadDemo
{
public static void main(String[] args)
{
Demo d= new Demo();
d.start();//只是调用了start方法怎么跑了run?
System.out.println("主线程跑");
}
}
class Demo extends Thread
{
public void run()
{
System.out.println("2号线程跑");
}
}
|
|