import java.io.*; public class TestFiles { public static void main(String[] args) { File textFile = new File("scores.txt"); if (textFile.exists()) { System.out.println("File alreasy exists."); } else { try { textFile.createNewFile(); System.out.println("New file created."); } catch (IOException e) { System.out.println("File could not be created."); System.err.println("IOException: " + e.getMessage()); } } } }