File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -451,9 +451,11 @@ public class CreateFile {
451451 Then if we run the program twice, the contents of <c >myfile.txt</c > would be:
452452 </p >
453453
454- <pre >
454+ <listing xml : id =" file-write-with-append-output" >
455+ <program >
455456 File successfully updated!File successfully updated!
456- </pre >
457+ </program >
458+ </listing >
457459
458460 <p >
459461 This doesn't look very good! If we want each additional write to appear on a new line? A simple solution is to use the <c >\n</c > newline character:
@@ -469,11 +471,14 @@ public class CreateFile {
469471 <p >
470472 Running the code with the newline character twice will result in the following contents in myfile.txt:
471473 </p >
472-
473- <pre >
474+
475+ <listing xml : id =" file-write-with-newline-output" >
476+ <program >
474477 File successfully updated!
475478 File successfully updated!
476- </pre >
479+ </program >
480+ </listing >
481+
477482 </section >
478483
479484 <section xml : id =" file-delete" >
You can’t perform that action at this time.
0 commit comments