Top Posters
Since Sunday
k
3
r
3
j
3
V
3
l
3
2
J
2
1
2
n
2
O
2
h
2
d
2
New Topic  
jmoney5 jmoney5
wrote...
Posts: 470
4 years ago
Which of the following statements are correct?

I:
File file = new File("input.txt");
try (Scanner input = new Scanner(file)) {
String line = input.nextLine();
}

II:
try (File file = new File("input.txt");
Scanner input = new Scanner(file);) {
String line = input.nextLine();
}

III:
File file;
try (file = new File("input.txt");
Scanner input = new Scanner(file);) {
String line = input.nextLine();
}

IV:
File file;
Scanner input;
try (file = new File("input.txt");
input = new Scanner(file);) {
String line = input.nextLine();
}


▸ I

▸ II

▸ III

▸ IV
Textbook 
Introduction to Java Programming, Comprehensive Version

Introduction to Java Programming, Comprehensive Version


Edition: 10th
Author:
Read 55 times
1 Reply
Replies
Answer verified by a subject expert
jrhome1985!jrhome1985!
wrote...
Posts: 375
4 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

jmoney5 Author
wrote...

4 years ago
Thanks
wrote...

Yesterday
You make an excellent tutor!
wrote...

2 hours ago
Brilliant
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  973 People Browsing
 106 Signed Up Today
Related Images
  
 317
  
 434
  
 395
Your Opinion
Which country would you like to visit for its food?
Votes: 215

Previous poll results: How often do you eat-out per week?