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  
barmour44 barmour44
wrote...
Posts: 420
3 years ago
Suppose you enter 34.3 57.8 789, then press the ENTER key. Analyze the following code.

Scanner input = new Scanner(System.in);
int v1 = input.nextInt();
int v2 = input.nextInt();
String line = input.nextLine();


▸ After the last statement is executed, line contains characters '7', '8', '9', '\n'.

▸ The program has a runtime error because 34.3 is not an integer.

▸ After the last statement is executed, v1 is 34.

▸ After the last statement is executed, line contains characters '7', '8', '9'.
Textbook 
Introduction to Java Programming, Comprehensive Version

Introduction to Java Programming, Comprehensive Version


Edition: 10th
Author:
Read 90 times
1 Reply
Replies
Answer verified by a subject expert
Cele_1015Cele_1015
wrote...
Posts: 388
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

barmour44 Author
wrote...

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

Yesterday
Correct Slight Smile TY
wrote...

2 hours ago
Thanks
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  1324 People Browsing
Related Images
  
 43
  
 242
  
 313
Your Opinion
What's your favorite coffee beverage?
Votes: 274