File tree Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ if [ $? -ne 0 ]; then
2020 reboot
2121 fi
2222else
23- FAILS=0
23+ FAILS=0
2424fi
2525
2626sleep 20
Original file line number Diff line number Diff line change 55import java .util .Random ;
66
77public class WriteToFile {
8- public static void main (String [] args ) {
9- try {
10- PrintStream writer = new PrintStream ( new File ("randInts.txt" ));
11- Random r = new Random ();
12- final int LIMIT = 100 ;
8+ public static void main (String [] args ) {
9+ try {
10+ PrintStream writer = new PrintStream ( new File ("randInts.txt" ));
11+ Random r = new Random ();
12+ final int LIMIT = 100 ;
1313
14- for (int i = 0 ; i < LIMIT ; i ++) {
15- writer .println ( r .nextInt () );
14+ for (int i = 0 ; i < LIMIT ; i ++) {
15+ writer .println ( r .nextInt () );
16+ }
17+ writer .close ();
1618 }
17- writer .close ();
18- }
19- catch (IOException e ) {
20- System .out .println ("Error: write to file" );
21- }
22- }
19+ catch (IOException e ) {
20+ System .out .println ("Error: write to file" );
21+ }
22+ }
2323}
You can’t perform that action at this time.
0 commit comments