summaryrefslogtreecommitdiffstats
path: root/Master/Reference Architectures and Patterns/hjp5/examples/Listing1809.java
blob: 3a6dde3801d68147b07ffc6265f802bdbc34ca6d (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
/* Listing1809.java */

import java.io.*;

public class Listing1809
{
  public static void main(String[] args)
  {
    LineNumberReader f;
    String line;

    try {
      f = new LineNumberReader(
          new FileReader("c:\\config.sys"));
      while ((line = f.readLine()) != null) {
        System.out.print(f.getLineNumber() + ": ");
        System.out.println(line);
      }
      f.close();
    } catch (IOException e) {
      System.out.println("Fehler beim Lesen der Datei");
    }
  }
}