I have this piece of code:
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);
}
}
}
and the output:
Your next move?
b
b
Your next move?
Your next move?
Your next move?
why Your next move?
is printed 3 times in a row without other codes in while loop be executed?