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; }