Top Posters
Since Sunday
a
5
k
5
c
5
B
5
l
5
C
4
s
4
a
4
t
4
i
4
r
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 175 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
Thanks
yen
wrote...

Yesterday
You make an excellent tutor!
wrote...

2 hours ago
This calls for a celebration Person Raising Both Hands in Celebration
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  1317 People Browsing
 126 Signed Up Today
Related Images
  
 42
  
 316
  
 838
Your Opinion
What's your favorite coffee beverage?
Votes: 274

Previous poll results: What's your favorite math subject?