In the following code for continuing the program user should press y character but when I press y the loop terminate
public class JavaFile
{
int i = 0;
public void systemIO()throws java.io.IOException {
System.out.println("Enter the character");
i = System.in.read();
System.out.println("the character Enter by the user : "+(char)i);
System.out.println("the assci vlue "+i);
}
public void cntApp()throws java.io.IOException{
char cnt = 'y';
while(cnt =='y'){
systemIO();
System.out.println("press 'y' if you want continue");
cnt = (char)System.in.read();
System.out.println("The Entery value "+cnt);
}
}
public static void main(String args[]) {
try{
new JavaFile().cntApp();
}catch(java.io.IOException ioExe){
System.out.println(ioExe);
}
}