How can Scanner read char? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How can Scanner read char?

I've Been trying but there's just Strings

7th Apr 2018, 8:00 PM
mateo quiceno toro
mateo quiceno toro - avatar
1 Answer
+ 3
You can't, but you could do this: for(char c : new Scanner(System.in).nextLine().toCharArray()) System.out.println(c);
7th Apr 2018, 8:20 PM
John Wells
John Wells - avatar