+ 2

How to make an input scanner for char in java?

input scanner

22nd Dec 2017, 1:54 AM
Jerico Infante
Jerico Infante - avatar
2 Réponses
+ 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);
22nd Dec 2017, 1:56 AM
James16
James16 - avatar
+ 1
Thank you james 👍😁
22nd Dec 2017, 7:58 AM
Jerico Infante
Jerico Infante - avatar