/**
*note: 桌面创建10个txt文件
*/
import java.io.*;
class TxtCreartor{
public static void main(String[] args) throws Exception{
String deskTopPath = "C:\\Users\\Administrator\\Desktop\\";
String path="";
for(int i=1; i<=10; i++){
path = deskTopPath + i + ".txt";
//System.out.println(deskTopPath);
File file = new File(path);
if(!file.exists())file.createNewFile();
}
}
}
12-31
8343
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-28
885
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
07-12
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交