ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change
on this file since 4fc45ff was
9c14ae9,
checked in by Rob Schluntz <rschlunt@…>, 8 years ago
|
add thesis source
|
-
Property mode set to
100644
|
File size:
544 bytes
|
Line | |
---|
1 | import java.io.IOException; |
---|
2 | |
---|
3 | public class res3 implements ires { |
---|
4 | public void write(String filename, String msg) throws Exception { |
---|
5 | try ( |
---|
6 | FileOutputStream out = new FileOutputStream(filename); // may throw FileNotFoundException |
---|
7 | FileOutputStream log = new FileOutputStream("log.txt"); // or SecurityException |
---|
8 | ) { |
---|
9 | out.write(msg.getBytes()); // may throw an IOException |
---|
10 | log.write(msg.getBytes()); // may throw an IOException |
---|
11 | } |
---|
12 | } |
---|
13 | |
---|
14 | public static void main(String[] args) { |
---|
15 | res.dotest(new res3()); |
---|
16 | } |
---|
17 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.