20th Apr 2017, 1:09 AM
Madusha chamal
Madusha chamal - avatar
3 Réponses
+ 8
nextChar() is not a method that the Scanner object contains. It's just next().charAt(0). Aside from that it works. However, code playground does not support multiple inputs, so you will have to use this code on a different compiler. Ik it sucks, but just the way code playground is designed.
20th Apr 2017, 1:52 AM
Rrestoring faith
Rrestoring faith - avatar
+ 6
There's not 'nextChar()' method... replace it with: // x =sc1.nextChar(); x =sc1.next().charAt(0); However, by using 'int' type for your number variables, the result of the division will be an integer too, so 3/2 return 1 ^^
20th Apr 2017, 1:46 AM
visph
visph - avatar
0
thank you
20th Apr 2017, 1:57 AM
Madusha chamal
Madusha chamal - avatar