Suppose you enter 34.3 57.8 789, then press the ENTER key. Analyze the following
ID: 3847666 • Letter: S
Question
Suppose you enter 34.3 57.8 789, then press the ENTER key. Analyze the following code.
Scanner input = new Scanner(System.in);
double v1 = input.nextDouble();
double v2 = input.nextDouble();
String line = input.nextLine();
A. After the last statement is executed, line contains characters '7', '8', '9'.
B. After the last statement is executed, line contains characters '7', '8', '9', ' '.
C. After the last statement is executed, line contains characters ' ', '7', '8', '9', ' '.
D. After the last statement is executed, line contains characters ' ', '7', '8', '9'.
Explanation / Answer
Option D is correct choice.
Explanation :
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.