import java.io.File;
public class hehe {
public static void main(String[] args){
String sep = File.separator;
String filename = "DDqd.txt";
String dir = "D:"+sep;
File f = new File(dir,filename);
if(f.exists()){
System.out.println("Filename:"+f.getAbsolutePath());
System.out.println("Large:"+f.length());
}else{
try{
f.createNewFile();
}catch(Exception ar){
ar.printStackTrace();
}
}
}
}
通过File类在计算机上创建制定的文件
最新推荐文章于 2021-08-27 17:16:55 发布