import java.io.File; public class FileExample { public static void main(String[] args) { File file = new File("example.txt"); if (file.exists()) { System.out.println("File exists: " + file.getName()); System.out.println("Absolute Path: " + file.getAbsolutePath()); System.out.println("File Size: " + file.length() + " bytes"); } else { System.out.println("File does not exist."); } } }