File file = File(C:\\Dossier_111\\fichier.txt”);它将显示完整路径:C:\\Dossier_111\\fichier.txt”.
System.out.println(路径:” + file.getAbsolutePath());
File file = File(C:\\文件111\\fichier.txt);Runtime:
字符串 absolutePath = file.getAbsolutePath();
String filePath = absolutePath.
substring(0,absolutePath.lastIndexOf(File.separator));
System.out.println(路径:” + filePath);
C:\\Folder111
Please disable your ad blocker and refresh the window to use this website.