Get your own Java server
import java.io.File;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    File myFile = new File("filename.txt");
    myFile.createNewFile();
    System.out.println(myFile.exists());
    File otherFile = new File("nofile.txt");
    System.out.println(otherFile.exists());
  }
}

              
true
false