mirror of
https://github.com/github/codeql.git
synced 2025-12-19 18:33:16 +01:00
17 lines
515 B
Java
17 lines
515 B
Java
import java.io.FileInputStream;
|
|
import java.io.FileNotFoundException;
|
|
import java.io.FileOutputStream;
|
|
import java.io.IOException;
|
|
|
|
public class TestTryWithResources {
|
|
public static void main(String[] args) throws IOException {
|
|
try (FileInputStream fis = new FileInputStream(args[0]);
|
|
FileOutputStream fos = new FileOutputStream(args[1])) {
|
|
System.out.println("worked");
|
|
} catch (FileNotFoundException e) {
|
|
System.out.println("file not found");
|
|
} finally {
|
|
System.out.println("finally");
|
|
}
|
|
}
|
|
} |