The purpose of this loop is to stop as soon as a period key is typed, but it is not working and I did not understand why.
import java.io.IOException;
public class ControlFlowTest {
public static void main(String[] args) throws java.io.IOException {
char ch ;
do{
ch = (char) System.in.read();
}while(ch != '.');
}