Top Posters
Since Sunday
5
a
5
k
5
c
5
B
5
l
5
C
4
s
4
a
4
t
4
i
4
r
4
New Topic  
baileymeredith baileymeredith
wrote...
Posts: 477
3 years ago
Suppose you enter 34.3, the ENTER key, 57.8, 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 2 is executed, v1 is 34.3.

▸ After line 4 is executed, line is null.

▸ After line 3 is executed, v2 is 57.8.

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

▸ After line 4 is executed, line contains character "\n".
Textbook 
Introduction to Java Programming, Comprehensive Version

Introduction to Java Programming, Comprehensive Version


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

Related Topics

wrote...

3 years ago
Correct Slight Smile TY
wrote...

Yesterday
You make an excellent tutor!
wrote...

2 hours ago
Smart ... Thanks!
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  1334 People Browsing
Related Images
  
 4429
  
 142
  
 243
Your Opinion
How often do you eat-out per week?
Votes: 79