File Exists Or Not In Java Example
Chapter:
File
Last Updated:
13-06-2016 19:34:00 UTC
Program:
/* ............... START ............... */
import java.io.File;
public class JavaFileExistsOrNot {
public static void main(String[] args) {
File file = new File("C:/javaFile.txt");
System.out.println(file.exists());
}
}
/* ............... END ............... */
Output
Notes:
-
java.io.File.exists() method tests the existence of the file or directory.
Tags
File Exists Or Not, Java