BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.in(Standard input stream)-
String c = br.ReadLine();
Nearly there, but this:
String c = br.readLine();-- a method used to read characters from input stream and put them in the string in one go not byte by byte.
It reads characters from the input reader (
BufferedReader doesn't know about streams) and returns a whole line in one go, not character by character. Think of it in layers, and "above" the
InputStreamReader layer, the concept of "bytes" doesn't exist anymore.
Also, note that you can read blocks of characters with a
Reader without reading a line:
read(char, int, int) - the point of
readLine() is that it will do the line ending detection for you.
(As noted in comments, it's also