ファイル入力
1 public class ReadSample
2 {
3 public static void main(String[] args)
4 {
5 try
6 {
7 java.io.FileReader f;
8 java.io.BufferedReader b;
9 String s;
10
11 f = new java.io.FileReader( args[0] );
12 b = new java.io.BufferedReader( f );
13
14 while( (s = b.readLine()) != null)
15 {
16 System.out.println( s );
17 }
18
19 b.close();
20 } catch(Exception e) {
21 System.out.println( e );
22 }
23 }
24 }