The program prompts the user to enter the filename from console and makes a File object of that file. Then different properties of the file are printed on the console.
String fileName = "";
System.out.println("Please enter the file name: ");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
fileName = br.readLine();
File file = new File (fileName);
System.out.println("Path: " + file.getAbsolutePath());
System.out.println("Last modified: " + file.lastModified());
System.out.println("Size in bytes: " + file.length());
System.out.println("Hidden: " + file.isHidden());