+ 1

Can someone explain why this doesn't work?

https://code.sololearn.com/cte4AL1yBofD/?ref=app

29th Nov 2017, 12:44 PM
Karl Jude
Karl Jude - avatar
2 Answers
+ 12
Fixed. 1. Use charAt(0) instead of charAt(1) 2. While taking string input after int/double, the ENTER pressed after the int input is considered as the string input. So it doesn't wait for the next input. That's why you must put an extra input.nextLine() to consume the ENTER. More details: https://stackoverflow.com/questions/26626106/why-string-inputs-after-integer-input-gets-skipped-in-java https://code.sololearn.com/cvJ42140AvMO/?ref=app
29th Nov 2017, 1:40 PM
Shamima Yasmin
Shamima Yasmin - avatar
+ 1
Thanks @Shamima Yasmin
29th Nov 2017, 1:57 PM
Karl Jude
Karl Jude - avatar