Which of the following statements are correct?

```
I:
try (PrintWriter output = new PrintWriter("output.txt")) {
output.println("Welcome to Java");
}

II:
try (PrintWriter output = new PrintWriter("output.txt");) {
output.println("Welcome to Java");
}

III:
PrintWriter output;
try (output = new PrintWriter("output.txt");) {
output.println("Welcome to Java");
}

IV:
try (PrintWriter output = new PrintWriter("output.txt");) {
output.println("Welcome to Java");
}
finally {
output.close();
}
```
a. I
b. II
c. III
d. IV


abc

Computer Science & Information Technology

You might also like to view...

Overloading a receiver occurs when the number of data bytes is greater than which of the following?

A. advertised window B. bandwidth C. sliding window D. ephemeral port

Computer Science & Information Technology

The ________ of a document offers identifying information at the top of a newsletter

Fill in the blank(s) with correct word

Computer Science & Information Technology

An attacker types more data in a field than the programmer expected. This is a(n) ________ attack

A. XSS B. directory traversal C. denial-of-service D. buffer overflow

Computer Science & Information Technology

Created in 1981, ________ brought together researchers in the field of computer science.

A. CSNET B. HTTP C. NSFNET D. ARPANET

Computer Science & Information Technology