我已经懂了,多谢大家哇!!!!!
public class Test4 {
public static int j;
public static void main(String[] args) {
new Thread() {
public void run() {
int i=0;
while(true) {
while(j>i) {
System.out.println(1111);
}
}
};
}.start();
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
j=1;
System.out.println(j);
}
}