标题: 一道线程的问题,求解答 [打印本页] 作者: pzfpang449 时间: 2013-2-7 10:13 标题: 一道线程的问题,求解答 public class Threads1 {
int x = 0;
public class Runner implements Runnable {
public void run() {
int current = 0;
for (int i = 0; i < 4; i++) {
current = x;
System.out.println(current + ", ");
x = current + 2;
}
}
}
public static void main(String[] args) {
new Threads1().go();
}
public void go() {
Runnable r1 = new Runner();
new Thread(r1).start();
new Thread(r1).start();
}
}