+ 1

Can anyone help me out why throws java. io.IOException for getting a character input from user is not working in sololearn

Getting user input single character

5th Apr 2019, 5:49 PM
Vasanthamalika
Vasanthamalika - avatar
2 Answers
+ 5
Try 'InputMismatchException' once. Or next idea is : Scanner sc = new Scanner(System.in); System.out.println( sc.nextLine().charAt(0) );
5th Apr 2019, 6:06 PM
Sarthak Pokhrel
Sarthak Pokhrel - avatar
+ 1
Thank you. I will try.
5th Apr 2019, 6:13 PM
Vasanthamalika
Vasanthamalika - avatar