1.通过Thread实现 public class TestThread extends Thread{ public TestThread(String name) { super(name); } public void run() { for(int i = 0;i<5;i++){ for(long k= 0; k <100000000;k++); System.out.println(this.getName()+" :"+i); } } public static
调用start(),则编译器开始执行run(); Tread()类: public class Test extends Thread{ private int tickets = 100; public void run(){ while(tickets>0){ System.out.println("卖出第"+tickets--+"票"); } } public static void main(String[] args){ new Test().sta