Puzzle: Threads + Javap
How many times will the loop iterate?
public class TestThreads extends Thread {
static int i = 0;
public void run() {
for( ; i < 5; i++) {
System.out.println(getName() + " " + i);
}
}
public static void main(String args []) {
new TestThreads().start();
new TestThreads().start();
}
}
The (long) answer is here:
http://www.javaranch.com/journal/200607/ThreadsAndJavap.html
