개발하자/JAVA중급

파일내용 읽어오기(영어만가능)

i구야 2015. 1. 31. 10:34

엔터의 int값은 13,10 이다

 

import java.io.*;

class A {
 public static void main(String args[]) throws Exception {
  FileInputStream fis = new FileInputStream("c:/aaa/b.txt");
  while (true) {
   int n = fis.read();
   if(n==-1){break;}
   System.out.print((char)n);
  }System.out.println();
 }
}