자바의 File 클래스는 파일과 폴더를 관리하는 클래스이다. 파일 객체를 생성하는 시점에서는 실제 파일의 존재 유무는 문제가 되지 않는다. 다만 해당 경로에 실제 파일이 존재하지 않을 때 File 객체로 파일을 읽으려고 하면 FileNotFoundException이 발생한다. 파일 객체 생성하기 File tempDir = new File("D:/temp"); // 폴더 객체 생성 if(!tempDir.exists()) // 폴더가 없을 때 tempDir.mkdir(); // 실제 폴더 생성 System.out.println(tempDir.exists()); // true // 파일 객체 생성 File newFile = new File("D:/temp/newFile.txt"); if(!newFile.exi..