本地讀取
/**
*
*/
package com.liu.interfaceTest;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* @author hexi
*
*/
public class FileInputTest {
public static void main(String[] arg) {
BufferedReader br = null;
try {
br = new BufferedReader(new FileReader("C:\\Users\\hexi\\Desktop\\11.txt"));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
String line = "";
try {
while ((line = br.readLine())!=null) {
System.out.println(line);
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}