MCPcopy Create free account
hub / github.com/DuGuQiuBai/Java / main

Method main

day21/code/day21_IO2/src/cn/itcast_04/BufferedDemo.java:15–39  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

13 */
14public class BufferedDemo {
15 public static void main(String[] args) throws IOException {
16 // ���
17 // BufferedWriter bw = new BufferedWriter(new FileWriter("bw.txt"));
18 // for (int x = 0; x < 10; x++) {
19 // bw.write("hello" + x);
20 // bw.newLine();
21 // bw.flush();
22 // }
23 // bw.close();
24
25 // ��ȡ����
26 BufferedReader br = new BufferedReader(new FileReader("bw.txt"));
27
28 // String s = br.readLine();
29 // System.out.println(s);
30 // s = br.readLine();
31 // System.out.println(s);
32
33 String line = null;
34 while ((line = br.readLine()) != null) {
35 System.out.println(line);
36 }
37
38 br.close();
39 }
40}

Callers

nothing calls this directly

Calls 2

readLineMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected