Skip to content

Commit d7220b0

Browse files
JJ27actions-user
authored andcommitted
Bot: Prettified Java code!
1 parent 61d313e commit d7220b0

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
package com.codefortomorrow.advanced.chapter14.examples;
2+
23
import java.io.*;
34

45
public class TryWithResources {
56

67
public static void main(String[] args) throws IOException {
78
File file = new File("names.txt");
89

9-
try (FileInputStream in = new FileInputStream(file);
10-
FileOutputStream out = new FileOutputStream("names_upper.txt")) {
11-
10+
try (
11+
FileInputStream in = new FileInputStream(file);
12+
FileOutputStream out = new FileOutputStream("names_upper.txt")
13+
) {
1214
int c;
13-
while ((c = in.read()) != -1)
14-
out.write(Character.toUpperCase((char)c));
15-
15+
while ((c = in.read()) != -1) out.write(
16+
Character.toUpperCase((char) c)
17+
);
1618
} catch (IOException e) {
1719
System.out.println("An IO Exception occurred.");
18-
e.printStackTrace(); // Prints error output stream.
20+
e.printStackTrace(); // Prints error output stream.
1921
}
2022
}
2123
}

0 commit comments

Comments
 (0)