Top Posters
Since Sunday
4
n
3
j
3
x
2
c
2
2
p
2
n
2
3
2
C
2
z
2
k
2
New Topic  
Izzy122 Izzy122
wrote...
Posts: 437
3 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 82 times
1 Reply
Replies
Answer verified by a subject expert
n00835996n00835996
wrote...
Posts: 345
3 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...

3 years ago
I appreciate what you did here, answered it right Smiling Face with Open Mouth
wrote...

Yesterday
Smart ... Thanks!
wrote...

2 hours ago
Helped a lot
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  929 People Browsing
Related Images
  
 356
  
 262
  
 7647
Your Opinion
What's your favorite funny biology word?
Votes: 329