不要吐槽我为啥不写try,catch。

默认的相对路径是在工作空间的目录下。

如图

 import java.io.*;
import java.util.*; public class filerw {
public static void main(String []args) throws IOException { String pathname = "in.txt";
FileReader reader = new FileReader(pathname);
BufferedReader br = new BufferedReader(reader);
String tmpString;
while( (tmpString = br.readLine())!= null) {
System.out.println(tmpString);
} File file = new File("out.txt"); FileWriter fw = new FileWriter(file.getName(),true);
String data = " This is a test";
fw.write(data);
fw.close(); FileWriter fw1 = new FileWriter(file);
BufferedWriter bw = new BufferedWriter(fw1);
bw.write(data);
bw.close(); }
}

最新文章

  1. 360浏览器下载excel问题解决方式
  2. C++小项目:directx11图形程序(七):modelclass
  3. Python 处理数据库返回结果
  4. ul li 下的元素内容垂直居中
  5. SVN和git的使用(附github的简单玩法)
  6. 从客户端中检测到有潜在危险的Request.Form值 的解决方法
  7. 【Stage3D学习笔记续】真正的3D世界(五):粒子特效
  8. 优化器的使用oracle ---explain plan
  9. Linux 软件源设置
  10. Python开篇
  11. 【Java SE】如何用Java实现反转排序
  12. Tutorial 02_熟悉常用的HDFS操作
  13. springboot国际化
  14. 第8章 枚举类&注解
  15. vim学习、各类插件配置与安装【转】
  16. Centos 密钥登录系统
  17. bzoj 1390: [Ceoi2008]Fence
  18. js模拟自动点击事件
  19. 【转载】IEEE754 学习总结
  20. CF 570 D. Tree Requests

热门文章

  1. python基础----找零问题
  2. 45-python基础-python3-字符串-常用字符串方法(三)-startswith()-endswith()
  3. shell数学运算
  4. docker镜像仓库
  5. Adapter的实现
  6. 人脸识别课件需要安装的python模块
  7. jQuery HTML- 添加元素
  8. python 中字符串中含变量方法
  9. centos 6.5 安装 zookeeper
  10. HttpClient类详解