You are viewing a single comment's thread. Return to all comments →
in the following line of code:
"System.out.println(sc.next()+" can't be fitted anywhere.");",instead of "sc.next",Why can't we write "sc.nextLong"?
Some of the other comments already mentioned it, but basically the nextLong() token threw an error, so reading the same token with next() allows us to repeat the token as part of the error message.