java中File类的getPath(),getAbsolutePath(),getCanonicalPath()区别
File file = new File(".\\test.txt");
System.out.println(file.getPath());
System.out.println(file.getAbsolutePath());
System.out.println(file.getCanonicalPath()); 返回的结果为:.\test.txt
E:\workspace\Test
转载
2017-06-05 10:16:20 ·
299 阅读 ·
0 评论