本帖最後由 蔡庭豪 於 2018-6-9 11:11 編輯
- package bbs.istak.org.tw;
- import java.io.File;
- import java.io.IOException;
- public class Main {
- public static void main(String[] args) {
-
- File file = new File("D://fake frank//fuck up.txt");
-
- if(!file.exists()){
-
- String path = file.getParentFile().getPath();
- File newfile = new File(path+"//fuck up.txt");
- newfile.getParentFile().mkdirs();
- try {
- newfile.createNewFile();
- } catch (IOException e) {
- // TODO 自動產生的 catch 區塊
- e.printStackTrace();
- }
-
- }
-
-
複製代碼 |