summaryrefslogtreecommitdiffstats
path: root/Master/Reference Architectures and Patterns/hjp5/examples/Listing1803.java
blob: 2ceee5f1c4c8c496fe1a395d7af0319b18fe40ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* Listing1803.java */

import java.io.*;

public class Listing1803
{
  public static void main(String[] args)
  {
    BufferedWriter f;
    String s;

    try {
      f = new BufferedWriter(
         new FileWriter("buffer.txt"));
      for (int i = 1; i <= 10000; ++i) {
        s = "Dies ist die " + i + ". Zeile";
        f.write(s);
        f.newLine();
      }
      f.close();
    } catch (IOException e) {
      System.out.println("Fehler beim Erstellen der Datei");
    }
  }
}