| DisplayFile.java |
1 /*
2 * @(#) $Id: DisplayFile.java,v 1.2 2003/07/08 08:13:52 pankaj Exp $
3 *
4 * Copyright (c) 2002-03 by Pankaj Kumar (http://www.pankaj-k.net).
5 * All rights reserved.
6 *
7 * The license governing the use of this file can be found in the
8 * root directory of the containing software.
9 */
10import java.io.*;
11
12public class DisplayFile {
13 public void disp(String fileName) throws IOException {
14 String line = null;
15 BufferedReader br = new BufferedReader(new FileReader(fileName));
16 while ((line = br.readLine()) != null)
17 System.out.println(line);
18 }
19 public static void main(String[] args) throws IOException {
20 if (args.length < 1){
21 System.out.println("Usage:: java DisplayFile <filename>");
22 return;
23 }
24 (new DisplayFile()).disp(args[0]);
25 }
26}