Java中File的getAbsolutePath()包含文件的名称
来源:互联网 发布:淘宝唯美的刻字印章 编辑:程序博客网 时间:2024/05/22 14:14
public static void test1(){
File file1 = new File(".\\test1.txt");
File file2 = new File("D:\\workspace\\test\\test1.txt");
System.out.println("-----默认相对路径:取得路径不同------");
System.out.println(file1.getPath());
System.out.println(file1.getAbsolutePath());
System.out.println("-----默认绝对路径:取得路径相同------");
System.out.println(file2.getPath());
System.out.println(file2.getAbsolutePath());
}
-----默认相对路径:取得路径不同------
.\test1.txt
D:\workspace\test\.\test1.txt
-----默认绝对路径:取得路径相同------
D:\workspace\test\test1.txt
D:\workspace\test\test1.txt
例子来自于网上。
0 0
- Java中File的getAbsolutePath()包含文件的名称
- JAVA中file的getPath getAbsolutePath和getCanonicalPath的不同
- java中file的getPath(),getAbsolutePath(),getCanonicalPath()的比较
- Java 中 File.getPath() getAbsolutePath()和getCanonicalPath()的不同
- java中File类的getPath(),getAbsolutePath(),getCanonicalPath()区别
- java中File类的getPath(),getAbsolutePath(),getCanonicalPath()区别
- java中File类的getPath(),getAbsolutePath(),getCanonicalPath()区别
- java中File类的getPath(),getAbsolutePath(),getCanonicalPath()区别
- java中File类的getPath(),getAbsolutePath(),getCanonicalPath()区别
- java中file类的三种获取路径的方法getPath(),getAbsolutePath(),getCanonicalPath()的比较
- java.io.File 中 getPath(), getAbsolutePath() 和 getCanonicalPath() 三个方法的区别
- java.io.File 中 getPath(), getAbsolutePath() 和 getCanonicalPath() 三个方法的区别
- java.io.File 中 getPath(), getAbsolutePath() 和 getCanonicalPath() 三个方法的区别
- java.io.File 中 getPath(), getAbsolutePath() 和 getCanonicalPath() 三个方法的区别
- java.io.File 的 getPath getAbsolutePath 和 getCanonicalPath 的不同
- java File 的getPath getAbsolutePath和getCanonicalPath的不同
- JAVA 之 file 的 getPath、getAbsolutePath和getCanonicalPath的不同
- file中getPath()和getAbsolutePath()和getCanonicalPath()方法的区别
- ionic2中利用自定义cordova插件(Plugin)ts调iOS原生的值(iOS原生的值传给ts)
- 华西乐购
- python+selenium firefox 驱动
- 如何下载和安装、使用xshell(安全终端模拟软件)工具
- python学习笔记4-字典
- Java中File的getAbsolutePath()包含文件的名称
- android 中静默安装APK实现代码
- app全fragment混少量Activity的切换逻辑
- 第八届蓝桥杯JAVAB组第四题
- WHAT
- 系统安装名词大全
- 最近整理的一些msm8909平台英文文档1
- gas-station
- 计算机科学界名言