Enter an integer: 1492 OK Enter an integer: Fourteen ninety two WRONG Enter an integer: 14.92 WRONG Enter an integer: -1492 OK Enter an integer: 1 4 9 2 MAYBE — only the '1' will be scanned
InputMismatchException
If the user enters one of the WRONG lines,
the statement
num = scan.nextInt()
This exception was passed out of the running program to the Java system, which stopped the program and wrote the error messages.
(Trick Question: ) Could the following be interpreted as an integer?
+84