摘要:
public class MyRunnable implements Runnable{ int a=0; public void run(){ for(a=0;a<10;a++){ try{Thread.sleep(100);}catch(Exception e){} System.out.println(Thread.currentThread().getName()+":"+a); } } public static void main(String[] args) { MyRu... 阅读全文
摘要:
public class MyThread extends Thread { public void run(){ for(int i=0;i<50;i++){ try{ Thread.sleep(100);}catch(Exception e){} System.out.println(Thread.currentThread().getName()+" : "+i); } } public static void main(String[] args) { MyThread t1 =... 阅读全文