0

Why does my program show No element exception...????

The program is incomplete.... though I tried to excite it... but it shows the exception.... https://code.sololearn.com/cYBuNu5jcOZA/?ref=app

16th Jan 2018, 5:55 AM
Nishchit Rao
Nishchit Rao - avatar
2 odpowiedzi
0
Because the Scanner 'myNish' has no elements, so calling nextFloat gives a NoSuchElementException. In code playground all inputs have to be given at the start.
16th Jan 2018, 7:53 AM
Dan Walker
Dan Walker - avatar
0
Tq.... finally worked out.......
16th Jan 2018, 2:10 PM
Nishchit Rao
Nishchit Rao - avatar