1、在winows环境下它们的区别是



getCanonicalPath是标准路径,没有特殊字符,getAbsolutePath是有特殊字符的

2、在AIX系统中它们的区别:

首先编译:javac com/ai/test/BugTest.java

然后运行:java com.ai.test.BugTest

最终结果如下:

经过上面测试它们的区别已经很明显了。

getCanonicalPath getAbsolutePath区别的更多相关文章

  1. File 类的 getPath()、getAbsolutePath()、getCanonicalPath() 的区别【转】

    File 类的 getPath().getAbsolutePath().getCanonicalPath() 的区别 感谢大佬:https://blog.csdn.net/zsensei/articl ...

  2. file的getPath getAbsolutePath和getCanonicalPath的区别

    转自:http://www.blogjava.net/dreamstone/archive/2007/08/08/134968.html file的这几个取得path的方法各有不同,下边说说详细的区别 ...

  3. 关于File.getPath,File.getAbsolutePath,File.getCanonicalPath的区别

    这个问题, 不了解一下还是挺恍惚它们之间的区别的. 其实也挺简单的. getPath()-->>new File()时的路径 getAbsolutePath()-->>当前路径 ...

  4. java里getPath、 getAbsolutePath、getCanonicalPath的区别

    本文链接:https://blog.csdn.net/wh_19910525/article/details/9314675 File的这三个方法在api中都有说明,仅以程序为例说明. package ...

  5. 【56】java本地文件File类详解

    1.java类的介绍 public class File extends Object implements Serializable, Comparable<File> 文件和目录路径名 ...

  6. File类心得

    File类心得 在程序中设置路径时会有系统依赖的问题,java.io.File类提供一个抽象的.与系统独立的路径表示.给它一个路径字符串,它会将其转换为与系统无关的抽象路径表示,这个路径可以指向一个文 ...

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

    File file = new File(".\\test.txt"); System.out.println(file.getPath()); System.out.printl ...

  8. file.getPath() getAbsolutePath() getCanonicalPath()区别

    package file; import java.io.File; import java.io.IOException; public class getFilePath { public sta ...

  9. file的getPath getAbsolutePath和getCanonicalPath的不同

    file的这几个取得path的方法各有不同,下边说说详细的区别 概念上的区别:(内容来自jdk,个人感觉这个描述信息,只能让明白的人明白,不明白的人看起来还是有点难度(特别试中文版,英文版稍好些)所以 ...

随机推荐

  1. [转]SSIS ADO.NET vs OLEDB

    本文转自:http://social.msdn.microsoft.com/Forums/sqlserver/en-US/1a9e3670-9685-4943-913b-123ecf248a9c/ol ...

  2. POJ 1275-Cashier Employment(差分约束系统)

    题目地址:id=1275">POJ 1275 题意: 给出一个超市24小时各须要R[i]个雇员工作,有N个雇员能够雇佣.他们開始工作时间分别为A[i],求须要的最少的雇员人数. 思路: ...

  3. curl错误码大全

    CURL状态码列表 状态码 状态原因 解释 0 正常访问 访问地址未返回结果 1 错误的协议 未支持的协议.此版cURL 不支持这一协议. 2 初始化代码失败 初始化失败. 3 URL格式不正确 UR ...

  4. 使用rsync进行多服务器同步

    使用rsync进行多服务器同步 @(Others) 当集群数量很大时,修改配置文件和节点之间的文件同步是一件很麻烦且浪费时间的事情. rsync是linux上实现不同机器之间文件同步.备份的工具,ce ...

  5. 利用Referer请求头阻止"盗链"

    转自:http://wisdomsong2007.blog.163.com/blog/static/47783725200882523820664/ 前言 有一些站点自己没有提供下载空间,但是为了吸引 ...

  6. 【ACM】Fighting for HDU

    #include <stdio.h> #include <stdlib.h> #define max 100 /* run this program using the con ...

  7. [莫队算法 线段树 斐波那契 暴力] Codeforces 633H Fibonacci-ish II

    题目大意:给出一个长度为n的数列a. 对于一个询问lj和rj.将a[lj]到a[rj]从小到大排序后并去重.设得到的新数列为b,长度为k,求F1*b1+F2*b2+F3*b3+...+Fk*bk.当中 ...

  8. Python中的关键字的用法

    Python有哪些关键字 -Python常用的关键字 and, del, from, not, while, as, elif, global, or, with, assert, else, if, ...

  9. Linux-Nginx-关闭进程

    当然就仅仅是介绍一条命令了,就这么简单. nginx默认创建一个工作进程 root 2713 1 0 07:56 ? 00:00:00 nginx: master process ../sbin/ng ...

  10. phpexcel表的一些设置

    $objPHPExcel = new PHPExcel(); $objPHPExcel->setActiveSheetIndex(0); //set default styles$objPHPE ...