public static void main(String[] args) {
try {
BufferedReader in = new BufferedReader(new FileReader("F:\\test.txt"));
String line = null;
try {
while((line = in.readLine())!=null)
{
System.out.println(line );
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
java读取txt
最新推荐文章于 2024-11-04 20:33:37 发布