Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (19k points)
I am trying to find a way to take a char input from the keyboard.

Any help?

1 Answer

0 votes
by (33.1k points)

To take input as exactly one character you could use:

char c = reader.findInLine(".").charAt(0);

Hope this answer helps you!

Related questions

0 votes
1 answer
asked Mar 20, 2021 in Java by Jake (7k points)
0 votes
1 answer
asked Mar 23, 2021 in Java by sheela_singh (9.5k points)
0 votes
1 answer
asked Feb 19, 2021 in Java by Jake (7k points)
0 votes
1 answer
0 votes
1 answer

Browse Categories

...