Solved

Consider the Following Code Snippet: Scanner in = New Scanner

Question 54

Multiple Choice

Consider the following code snippet: Scanner in = new Scanner(. . .) ;
String result = "";
Int number = 0;
If (in.hasNextInt() )
{
Number = in.nextInt() ;
}
Result = in.next() ;
If the input begins with the characters 626.14 average, what values will number and result have after this code is executed?


A) number will contain the value 626 and result will contain the value 14.
B) number will contain the value 626.14 and result will contain the value average.
C) number will contain the value 0 and result will contain the value 626.14.
D) number will contain the value 0 and result will contain the value average.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions