import java.io.File;
import java.io.IOException;
public class FileTest {
public static void main(String[] args) {
// String filepath = "D:\\aaa.txt";
// File file = new File(filepath);
// try {
// file.createNewFile();
// } catch (IOException e) {
// e.printStackTrace();
// }
// File parentfile = new File("D:\\");
// String filepath = "aaa.txt";
// File file = new File(parentfile,filepath);
// try {
// file.createNewFile();
// } catch (IOException e) {
// e.printStackTrace();
// }
// String parentpath = "D:\\";
// String filename = "bbb.txt";
// File file = new File(parentpath, filename);
// try {
// file.createNewFile();
// } catch (IOException e) {
// e.printStackTrace();
// }
}
}
Java笔记总结(三十二)---文件流&创建文件的三种方式
最新推荐文章于 2024-04-27 09:13:51 发布