number = scan. nextInt (); / / User enters 12, hits ENTER
System. out. println ("1: " + number);
number = scan. nextInt (); / / User enters 56, hits ENTER
System. out. println ("2: " + number);
number = scan. nextInt (); / / User enters 99ABC, hits ENTER
System. out. println ("3: " + number);
}
catch (Exception e)
{
String s = scan. nextLine ();
System. out. println ("4: " + number);
}
finally
{
number = scan. nextInt (); / / User enters 100, hits ENTER
System. out. println ("5: " + number);
}
+3
Answers (1)
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “What is the output of the following sequence? Scanner scan = new Scanner (System. in); int number = 0; try { number = scan. nextInt (); / / ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Home » Computers & Technology » What is the output of the following sequence? Scanner scan = new Scanner (System. in); int number = 0; try { number = scan. nextInt (); / / User enters 12, hits ENTER System. out. println ("1: " + number); number = scan.