I'm just learning how to use Java, and I have an assignment that asks us to create a file, yet Java is telling me that the file doesn't exist and I don't know why. I'm supposed to make sure my file exists before proceeding with anything else. This is what I have so far:
import java.io.*;
import java.util.Scanner;
public class Party {
public static void main(String [] args) throws IOException {
File file = new File("party.txt");
if (!file.exists()) {
System.out.println("The file party.txt doesn't exist.");
}
}
}