+ 2
How to make an input scanner for char in java?
input scanner
2 Answers
+ 7
You could take the first character from Scanner.next:
char c = reader.next().charAt(0);
To consume exactly one character you could use:
char c = reader.findInLine(".").charAt(0);
To consume strictly one character you could use:
char c = reader.next(".").charAt(0);
+ 1
Thank you james đđ