I am trying to write a program that prompts the user to enter a single character e.g 'Y'. The problem is that when I try to read it using the BufferedReader Object: readLine() method and do some comparism with another char variable, it gives me the wrong result, ie always 'No' No matter the input. Does anybody know of a method used to read in a single character?
My code is as follows;
String InData; String intData1 = "Y"'; BufferedReader dataString = new BufferedReader (new InputStreamReader(System.in)); System.out.println("Would you like pin strip (�250.00) Y/N"); InData=dataString.readLine();