欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > 文章正文

java判断文件是否存在,java判断文件存在,package cn.o

来源: javaer 分享于  点击 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);    }}
相关栏目:

用户点评