public static void main(String[] args) { try { BufferedReader in = new BufferedReader(new FileReader("wangaw.txt")); String str; while ((str = in.readLine()) != null) { System.out.PRintln(str); } System.out.println(str); } catch (IOException e) { } }
读取文件的内容
in.readLine()整行的读取,当读到为空的时候停止
新闻热点
疑难解答