File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
src/com/codefortomorrow/advanced/chapter14/examples Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change 11package com .codefortomorrow .advanced .chapter14 .examples ;
2+
23import java .io .*;
34
45public class FileIO {
@@ -12,17 +13,15 @@ public static void main(String[] args) throws IOException {
1213 in = new FileInputStream (file );
1314 out = new FileOutputStream ("names_upper.txt" );
1415 int c ;
15- while ((c = in .read ()) != -1 )
16- out . write ( Character .toUpperCase ((char )c ));
17-
16+ while ((c = in .read ()) != -1 ) out . write (
17+ Character .toUpperCase ((char ) c )
18+ );
1819 } catch (IOException e ) {
1920 System .out .println ("An IO Exception occurred." );
20- e .printStackTrace (); // Prints error output stream.
21+ e .printStackTrace (); // Prints error output stream.
2122 } finally {
22- if (in != null )
23- in .close ();
24- if (out != null )
25- out .close ();
23+ if (in != null ) in .close ();
24+ if (out != null ) out .close ();
2625 }
2726 }
2827}
You can’t perform that action at this time.
0 commit comments