File file = File("C:\\Dossier_111\\fichier.txt");It will display the full path: "C:\\Dossier_111\\fichier.txt".
System.out.println("Path: " + file.getAbsolutePath());
File file = File("C:\\ File111\\fichier.txt");Runtime:
String absolutePath = file.getAbsolutePath();
String filePath = absolutePath.
substring(0,absolutePath.lastIndexOf(File.separator));
System.out.println("Path: " + filePath);
C:\\Folder111
Please disable your ad blocker and refresh the window to use this website.