Top Posters
Since Sunday
t
7
m
6
k
6
F
5
j
5
t
5
j
5
G
5
f
5
a
5
d
5
c
5
New Topic  
Izzy122 Izzy122
wrote...
Posts: 437
4 years ago
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();


▸ After line 4 is executed, line contains an empty string.

▸ After line 2 is executed, v1 is 34.3.

▸ After line 4 is executed, line contains character "abc".

▸ After line 3 is executed, v2 is 57.8.

▸ After line 4 is executed, line is null.
Textbook 
Introduction to Java Programming, Comprehensive Version

Introduction to Java Programming, Comprehensive Version


Edition: 10th
Author:
Read 87 times
1 Reply
Replies
Answer verified by a subject expert
n00835996n00835996
wrote...
Posts: 345
4 years ago
Sign in or Sign up in seconds to unlock everything for free
More solutions for this book are available here

Related Topics

Izzy122 Author
wrote...

4 years ago
Thank you, thank you, thank you!
wrote...

Yesterday
Thanks
wrote...

2 hours ago
This helped my grade so much Perfect
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  797 People Browsing
Related Images
  
 457
  
 246
  
 181
Your Opinion
Who's your favorite biologist?
Votes: 587