0
Please, I need help debugging.
2 Réponses
+ 4
Emediong “Taki” Inyangetuk
No need of 2 scanner object
1 scanner object is enough to take values.
+ 3
The error happens because you try to read from a empty stream (for get N2).
Internally the Scanner class fill an internal buffer at any read (next call) then when you init f Scanner System.in is yet readed from sc Scanner then f will raise an exception because it cannot read from the in.
You can solve by using one Scanner only or read from only one of them