1 2 3 4 5 6 7 8 9
|
import java.io.File; public class Test{ public static void main(String[] args) throws Exception { File f = new File( "d:/io" ); f.mkdirs(); f = new File( "d:/io/test.txt" ); f.createNewFile(); } } |
创建一个指定的文件和指定的目录
1 2
|
File d = new File( "D:\\io\\test.txt" ); d.createNewFile(); |
java中如何创建一个指定文件,一个指定的目录,布布扣,bubuko.com
原文:http://www.cnblogs.com/xuhb/p/3600605.html