love_yun
2016-01-06 10:37
if (!file.exists())
try {
file.createNewFile();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
if (!file.exists()) //判断文件是否存在,!file.exists()条件是说文件不存在。
try {
file.createNewFile(); // 不存在就创建
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
流的那张说的很清楚
Java眼中的XML 文件写入
55791 学习 · 138 问题
相似问题
回答 3
回答 1