guyu-

 


 

 1 package com.guyu.day0914;
 2 
 3 import java.io.BufferedReader;
 4 import java.io.FileReader;
 5 import java.io.IOException;
 6 
 7 /**
 8  * @Author: Fred
 9  * @Date: 2020/9/14 10:58
10  */
11 public class Demo01 {
12     public static void main(String[] args) {
13 
14         //使用 readLine() 方法来读取文件 guyu.txt 内容,
15         //其中 guyu.txt 文件内容为:您好 故屿!
16         try {
17             BufferedReader in = new BufferedReader(new FileReader("guyu.txt"));
18              String str;
19             while ((str = in.readLine()) != null) {
20             System.out.println(str);
21         }
22         System.out.println(str);
23         } catch (IOException e) {
24             //Nothing
25         }
26     }
27 }

 

 


 

Note:
欢迎点赞,留言,转载请在文章页面明显位置给出原文链接
知者,感谢您在茫茫人海中阅读了我的文章
没有个性 哪来的签名!
详情请关注点我
持续更新中

© 2020 09 - Guyu.com | 【版权所有 侵权必究】

分类:

技术点:

相关文章:

  • 2022-02-09
  • 2021-09-05
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
  • 2023-02-08
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2022-01-01
  • 2021-05-18
  • 2022-02-07
  • 2022-01-18
相关资源
相似解决方案