我有这段代码:
import java.io.IOException;
public class Sample {
public static void main(String[] args) throws IOException {
int b = 3;
int c = 5;
char mov;
while(b != c) {
System.out.println("Your next move?");
mov = (char)System.in.read();
System.out.println(mov);
}
}
}
和输出:
Your next move?
b
b
Your next move?
Your next move?
Your next move?
为什么Your next move?
连续打印3次而没有其他代码执行while循环?