I am learning JAVA and typed the following DO...WHILE example. The program will quit if I type 'q'. It runs but why I get three rows of "Please a key followed by ENTER:"?
class DWDemo {
public static void main (String args[])
throws java.io.IOException {
char ch;
do {
System.out.println("Please a key followed by ENTER:");
ch = (char) System.in.read();
} while (ch != 'q');
}
}