Scanner.reset() doesn't work
<p>This peice of code is supposed to get an integer number from user and then finish the program. If the user inputs an invalid number, it asks user again.</p>

<p>After catching exception, it uses <code>Scanner.reset()</code> to reset the scanner, but it doesn't work. and it re-throws previous exception.</p>

<pre><code>Scanner in = new Scanner(System.in);
while (true) {
    try {
        System.out.print("Enter an interger number: ");
        long i = in.nextLong();
        System.out.print("Thanks, you entered: ");
        System.out.println(i);
        break;
    } catch (InputMismatchException ex) {
        System.out.println("Error in your input");
        in.reset(); // &lt;----------------------------- [The reset is here]
    }
}
</code></pre>

<p>I thought <code>Scanner.reset()</code> will reset everything and forget the exception. I put it before asking the user for a new input.</p>

<p>If I get the point wrong, what is the right way?</p>
