public static void main(String[] args) throws IOException {
System.out.println(System.getProperty("user.dir"));//这里输出 D:\workspace

System.setProperty("user.dir","D:/temp");
     System.out.println(System.getProperty("user.dir"));//这里输出 D:\temp
File file = new File("HELLO.txt");
System.out.println(file.getAbsolutePath()); //这里输出 D:\temp\HELLO.txt
System.out.println(file.createNewFile()); //这里输出 true
System.out.println(file.getAbsolutePath()); //这里输出 D:\temp\HELLO.txt
}
以上代码为什么最后的文件还是创建在了 D:\workspace 中