Question: Suppose we have a Scanner trying to read over the following: 4.2 abc 4 Select all correct answer(s) below: nextInt() tries to read next token

Suppose we have a Scanner trying to read over the following: 4.2 abc 4 Select all correct answer(s) below: nextInt() tries to read next token 4.2, couldn't process it as an int. java.util.Input MismatchException nextDouble() returns 4.2 as a double. It tried to read next token, succeeded because it could be read as a double. next() returns "4.2" as a String nextLine() returns "4.2 abc 4" as a String
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
