Scanner sc=new Scanner(new FileReader("D:\\text.txt")); String line=null; while((sc.hasNextLine()&&(line=sc.nextLine())!=null)){ if(!sc.hasNextLine()) System.out.println(line); }
java读取文件的最后一行数据
猜你喜欢
转载自blog.csdn.net/zhaoraolin/article/details/80085230
今日推荐
周排行