public class gp28{public static void main (String args[]){int i;test p=new test();Thread s=new Thread (p);s.start();for(i=0;i<100;i++){try{sleep(2000);}catch(InterruptedException e){e.printStackTrace();}System.out.println("main thread:"+i);}}}class test implements Runnable{public void run(){for(int i=0;i<100;i++){System.out.println("thread 2:"+i);}}}運行錯誤請幫忙看看,謝謝
添加回答
舉報
0/150
提交
取消