import java.io.*;
class Check
{
public static void main(String args[])throws IOException
{
char a,b;
InputStreamReader isr=new InputStreamReader(System.in);
BufferedReader buf=new BufferedReader(isr);
a=(char)buf.read();
b=(char)buf.read();
System.out.println(a+" "+b);
}
}
I am using this code to input 2 characters in JAVA. However, on executing, only the first character is getting printed. Why is so happening? And what should I do to overcome it?