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
7.7k 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
8.2k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.