File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed
src/main/java/com/javaprogramto/files/printwriter/newline Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com .javaprogramto .files .printwriter .newline ;
2
+
3
+ import java .io .PrintWriter ;
4
+
5
+ public class PrintWriterNewLine {
6
+
7
+ public static void main (String [] args ) {
8
+
9
+ PrintWriter printWriter = new PrintWriter (System .out );
10
+
11
+ printWriter .write ("this is the first line" );
12
+ printWriter .write ("\n " );
13
+ printWriter .write ("this is the second line" );
14
+ printWriter .write ("\n " );
15
+ printWriter .write ("third line" );
16
+
17
+ printWriter .flush ();
18
+
19
+ printWriter .close ();
20
+
21
+ }
22
+ }
Original file line number Diff line number Diff line change
1
+ package com .javaprogramto .files .printwriter .newline ;
2
+
3
+ import java .io .PrintWriter ;
4
+
5
+ public class PrintWriterNewLine2 {
6
+
7
+ public static void main (String [] args ) {
8
+
9
+ PrintWriter printWriter = new PrintWriter (System .out );
10
+
11
+ printWriter .println ("this is the first line" );
12
+ printWriter .println ("this is the second line" );
13
+ printWriter .println ("third line" );
14
+
15
+ printWriter .flush ();
16
+
17
+ printWriter .close ();
18
+
19
+ }
20
+ }
You can’t perform that action at this time.
0 commit comments