public class Practice {
public static void main(String []args)
throws IOException{
char ch;
int xh;
ch=(char)System.in.read();
xh=System.in.read();
System.out.println(ch);
System.out.println(xh);
}
}
If it puts an input of 1 in for
, the char
value in the System.in.read();
will use that value for the xh
.
For instance, if I put 1 in it, it will automatically give 1, 10 and will not give me an option to input my int
value.
Why is that? Also, I know I can use a scanner instead, but I don't want to.