Java examples for File Path IO:Text File
Reading Text from a File
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; public class Main { public void main(String[] argv) { try {//ww w . ja v a2 s .c om BufferedReader in = new BufferedReader(new FileReader("infilename")); String str; while ((str = in.readLine()) != null) { System.out.println(str); } in.close(); } catch (IOException e) { } } }