打印时有问题,不知道哪里错了!
class QOneThread implements Runnable{private int f[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17};
public QOneThread(){ }
public synchronized void run(){
for(int j = 0; j < f.length; j++)
System.out.print(f[j] +" ");
System.out.println();
}
}
class QuestionOne{
public static void main(String args[]){
new Thread(new QOneThread()).start();
new Thread(new QOneThread()).start();
}
}