You are viewing a single comment's thread. Return to all comments →
Hi, Why you used sc.next() in the Exception block ? Can you please Explain me ?
long x = sc.nextLong() throws the Exceptions, so the Token (the number) will never get parsed. So he has to parse the number via sc.next() as a String, so its available in the error message.