import java.io.File; |
import java.io.IOException; |
public class CreateNewFile{ |
public static void main(String[] args){ |
File f = new File( "f:\\bchxsx.java" ); // 实例化File类的对象 |
try { |
f.createNewFile(); //根据给定的路径创建文件 |
} catch (IOException e){ |
e.printStackTrace(); |
} |
} |
} |