标签:
1 public class TestThread1 { 2 public static void main(String args[]) { 3 Runner1 r = new Runner1(); 4 //r.start(); 5 //r.run(); 6 Thread t = new Thread(r); 7 t.start(); 8 9 for(int i=0; i<100; i++) { 10 System.out.println("Main Thread:------" + i); 11 } 12 } 13 } 14 15 class Runner1 implements Runnable { 16 //class Runner1 extends Thread { 17 public void run() { 18 for(int i=0; i<100; i++) { 19 System.out.println("Runner1 :" + i); 20 } 21 } 22 }
标签:
原文地址:http://www.cnblogs.com/roger-h/p/4495731.html