我写了一个程序,下面是它的一部分.当我在计算机上运行它时,它运行得很好.但是当我把它复制到我朋友的电脑上时,就会显示FileNotFoundException在第四行.
String d = System.getProperty("user.home");
String dir = d + "\\Documents\\CarPark";
new File(dir + "\\abnormal").mkdir();
PrintWriter restoreNo = new PrintWriter(new FileOutputStream(dir + "\\abnormal\\restoreNo.txt"));
Run Code Online (Sandbox Code Playgroud)
谁知道问题出在哪里?谢谢!