Suppose you enter 34.3, the ENTER key, 57.8, the ENTER key, abc, the Enter key. Analyze the following code.
```
1 Scanner input = new Scanner(System.in);
2 double v1 = input.nextDouble();
3 double v2 = input.nextDouble();
4 String line = input.nextLine();
```
a. After line 2 is executed, v1 is 34.3.
b. After line 3 is executed, v2 is 57.8.
c. After line 4 is executed, line contains an empty string.
d. After line 4 is executed, line is null.
e. After line 4 is executed, line contains character "abc".
a. After line 2 is executed, v1 is 34.3.
b. After line 3 is executed, v2 is 57.8.
c. After line 4 is executed, line contains an empty string.
You might also like to view...
Which of the following is the correct way to declare a variable that represents the desired quantity of an item in an order?
double numItems; INT numItems; int numItems; DOUBLE numItems;
To indicate the end of a conditional comment, you would use ____.
A. B. C. D.
To delete data from the database, use the ____ command.
A. ROLLBACK B. COMMIT C. DELETE D. UPDATE
What tool does Java provide to compare the relationship between the variables being tested in conditional statements?
A. byte analysis B. logical operators C. relational operators D. static methods