package com.qzkj.IO;

import java.io.File;
import java.io.IOException;

public class FileCreate {
	public static void main(String[] args) {
		//删除文件  若存在则删除,不存在则创建
		String path = "F:\\test.txt";
		File f = new File(path);
		if(f.exists()){
			f.delete();
			System.out.println("删除成功!");
			
		}else{
			
		
		try {
			
			f.createNewFile();
			System.out.println("文件不存在,创建成功!");
		}catch(IOException e){
			e.printStackTrace();
		}
		}
		}
	
	}


最近下载更多
wjdxsj  LV1 2020年11月2日
chenqiwax  LV4 2019年8月2日
han108  LV16 2019年3月6日
飞翔的企鹅嗯嗯  LV11 2019年1月30日
localhost1  LV1 2018年7月4日
都是老虎啊  LV12 2018年6月25日
925386146  LV1 2017年8月8日
wade123  LV31 2014年11月7日
最近浏览更多
heqian  LV16 2023年1月10日
任家毅  LV1 2021年6月1日
微量的记忆  LV10 2021年4月12日
wjdxsj  LV1 2020年11月2日
yhj123  LV2 2020年6月19日
jsjlvpan  LV1 2019年9月18日
废人a123456789 2019年8月6日
暂无贡献等级
chenqiwax  LV4 2019年8月2日
cheeseni  LV1 2019年7月6日
飞翔的企鹅嗯嗯  LV11 2019年1月30日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友