Question: In a new or /reset JShell session, repeat Exercise 25.21 without importing class Scanner to demonstrate that the package java.util is already imported in JShell.
In a new or /reset JShell session, repeat Exercise 25.21 without importing class Scanner to demonstrate that the package java.util is already imported in JShell.
Exercise 25.21
Import class Scanner then create a Scanner object input for reading from System.in. What happens when you execute the statement:
int number = input.nextInt()
and the user enters the string "hello"?
Step by Step Solution
3.37 Rating (166 Votes )
There are 3 Steps involved in it
jshell Scanner input new Scanner Systemin input javautilScanner E i... View full answer
Get step-by-step solutions from verified subject matter experts
