改错
public class test {
private int i;
public void next(){i++;}
public int getValue(){return i;}
public static void main(String[] args){
test tt=new test();
new Thread("Watcher"){
public void run(){
final int val=tt.getValue();
while(true){
if(val%2!=0){
System.out.println(val);
System.exit(0);
}
}
}
}.start();
while(true) tt.next();
}
};