블로그 이미지
다엄
잘해야지

calendar

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 26 27 28
29 30 31

Notice

    'Programming/Java'에 해당되는 글 10

    1. 2010.07.15 Java File Reader
    2010. 7. 15. 16:21 Programming/Java


    public void FileReader(String fname) throws IOException{
      String a;
      ArrayList<String> fstr = new ArrayList<String>();
      File f = new File(fname);
      try {
       BufferedReader in = new BufferedReader(new FileReader(f));
       while ((a=in.readLine()) != null){
        fstr.add(a);
       }
       in.close();
      } catch (FileNotFoundException e) {
       e.printStackTrace();
       System.out.println("Error! File is not Founded.");
      }
     }

    posted by 다엄