Java tutorial
import java.io.File; public class Main { public static void main(String[] argv) { // Create a File object File dummyFile = new File("dummy.txt"); // Check for the file's existence boolean fileExists = dummyFile.exists(); if (fileExists) { System.out.println("The dummy.txt file exists."); } else { System.out.println("The dummy.txt file does not exist."); } } }