java中File类的getPath(),getAbsolutePath(),getCanonicalPath()区别

来源:互联网 发布:北京万户网络怎么样 编辑:程序博客网 时间:2024/06/06 08:52
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\.\test.txt E:\workspace\Test\test.txt 
阅读全文
0 0