java判断文件是否存在,java判断文件存在,package cn.o
分享于 点击 31984 次 点评:206
java判断文件是否存在,java判断文件存在,package cn.o
package cn.outofmemory.snippets.core;import java.io.File;public class CheckIfFileExists { public static void main(String[] args) { File file = new File("C://file.txt"); // Tests whether the file denoted by this abstract pathname exists. boolean exists = file.exists(); System.out.println("File " + file.getPath() + " exists: " + exists); }}
用户点评