boolean isFileExist(String filePath)

import java.io.*;

class  JdugeFileExist
{
    public static boolean isFileExist(String filePath) {  
        File file = new File(filePath);  
        return file.isFile();  // 不存在/为目录,都是返回 false 
    }

    public static void main(String[] args) 
    {
        boolean bRet=isFileExist(args[0]);
        System.out.println(args[0]);
        System.out.println(bRet);
    }
}

 

posted @ 2018-03-28 11:09  sky20080101  阅读(177)  评论(0)    收藏  举报