177k views
2 votes
The Scanner.nextInt method throws an unchecked ____ if a user enters an input that is not an integer.

A) InputMismatchException

B) NumberFormatException

C) IllegalArgumentException

D) IOException

2 Answers

4 votes

The Scanner.nextInt method throws an unchecked ____ if a user enters an input that is not an integer.

A) InputMismatchException

B) NumberFormatException

C) IllegalArgumentException

D) IOException

User Umesh Suryawanshi
by
5.0k points
4 votes

Answer:

A) Input Mismatch Exception

Step-by-step explanation:

The Scanner.nextInt method throws an unchecked Input Mismatch Exception if a user enters an input that is not an integer.

User Philip Dreyer
by
5.1k points