首页 > 编程知识 正文

java判断文件是否为空,输入x计算并输出y的值

时间:2023-05-04 21:09:27 阅读:145127 作者:4769

ydook3360Java:判断文件是否存在,如果不存在, YDOOK JY Lin文章目录ydook3360Java:判断文件是否存在,如果不存在, YDOOK JY Lin1.实例代码

1 .确定实例代码//文件是否存在,如果不存在,则为publicstaticvoidhascreatefile (string path _ name ) try ) system.out.println ) if (! file.exists () ) system.out.println ) ' filenotexit! 已创建!' ); file.createNewFile (; }catch(ioexceptione ) system.out.println ) ' filenotexit! IOException=' e; }

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。