java代码:

import java.io.*;//导入所需的包
public class IOTest {//类
public static void main(String[] args){//主程序,程序入口
File file=new File("D:\\Qiju_Li");
if(!file.exists()){//如果文件夹不存在
file.mkdir();//创建文件夹
}
try{//异常处理
//如果Qiju_Li文件夹下没有Qiju_Li.txt就会创建该文件
BufferedWriter bw=new BufferedWriter(new FileWriter("D:\\Qiju_Li\\Qiju_Li.txt"));
bw.write("Hello I/O!");//在创建好的文件中写入"Hello I/O"
bw.close();//一定要关闭文件
}catch(IOException e){
e.printStackTrace();
}
}
}

最新文章

  1. curl发送get和post请求
  2. Android使用SAX解析XML(2)
  3. ExpandableListView二级列表
  4. C#中动态读写App.config配置文件
  5. Requirements of an SAP system administrator
  6. openstack neutron网络主机节点网口配置 liberty版本之前的
  7. 典型的 SQL 注入过程(转)
  8. kettle不能正常自动获取字段
  9. Linux curses库使用
  10. WINFORM窗体里使用网页控件的一些办法
  11. iOS之网络编程
  12. pipe管道
  13. golang 线程与通道
  14. OO电梯调度
  15. 如何用 Python 模糊搜索文件
  16. rosetta geometric constraint file(用于match和design)
  17. liunx存储管理之基础知识
  18. 地图上道路编号中的G S X Y
  19. vijos 1128 N个数选K个数 (DFS )
  20. ubuntu上安装ftp

热门文章

  1. Nginx快捷启动配置
  2. win10 python3.5 自动补全设置
  3. 在spring中如何生成一个bean (一个对象,比如jedis的连接池对象)【我】
  4. 苹果电脑python3安装pillow模块
  5. 微信小程序之自定义select下拉选项框组件
  6. bind,apply,call,caller,callee还傻傻分不清楚?
  7. Prometheus-自定义Node_Exporter
  8. sklearn-标准化标签LabelEncoder
  9. Http接口开发(自测服务端客户端)
  10. Linux记录-使用python临时搭建web服务器