当前位置: 首页 > news >正文

建手机网站价格怎样在网上做宣传

建手机网站价格,怎样在网上做宣传,湖南网站建设制作公司,做网站找哪家公司好1.getAbsolutePath() 得到绝对路径、全路径。 getpath() 得到缩写的路径,根据当前目录位置可以缩写路径。得到相对路径。 getCanonicalPath() 得到标准路径,将统一平台间的路径写法差异。 File的这三个方法在api中都有说明,仅以程序为例说明。…

1.getAbsolutePath() 得到绝对路径、全路径。

   getpath() 得到缩写的路径,根据当前目录位置可以缩写路径。得到相对路径。

   getCanonicalPath() 得到标准路径,将统一平台间的路径写法差异。

File的这三个方法在api中都有说明,仅以程序为例说明。
package test;
import  java.io.File;
import java.io.IOException;
public class TestFilePath {
 
 public static void main(String[] args) {
  // TODO Auto-generated methodstub
  System.out.println(System.getProperty("user.dir"));
  
  try {
   System.out.println("-----默认相对路径:取得路径不同------");
    File file1 =new File("..\\src\\test1.txt");
   System.out.println( file1.getPath());
   System.out.println( file1.getAbsolutePath());
   System.out.println(file1.getCanonicalPath());
   System.out.println("-----默认相对路径:取得路径不同------");
   File file =new File(".\\test1.txt");
   System.out.println(file.getPath());
   System.out.println(file.getAbsolutePath());
   System.out.println(file.getCanonicalPath());
   
   System.out.println("-----默认绝对路径:取得路径相同------");
   File file2 =new File("D:\\workspace\\test\\test1.txt");
   System.out.println(file2.getPath());
   System.out.println(file2.getAbsolutePath());
   System.out.println(file2.getCanonicalPath());
  } catch (IOException e) {
   // TODOAuto-generated catch block
   e.printStackTrace();
  }
 }
}
程序执行结果如下:
F:\eclipseworkspace\testejb
-----默认相对路径:取得路径不同------
..\src\test1.txt
F:\eclipseworkspace\testejb\..\src\test1.txt
F:\eclipseworkspace\src\test1.txt
-----默认相对路径:取得路径不同------
.\test1.txt
F:\eclipseworkspace\testejb\.\test1.txt
F:\eclipseworkspace\testejb\test1.txt
-----默认绝对路径:取得路径相同------
D:\workspace\test\test1.txt
D:\workspace\test\test1.txt
D:\workspace\test\test1.txt
结论:
当输入为绝对路径时,返回的都是绝对路径。
当输入为相对路径时:
getPath()返回的是File构造方法里的路径,是什么就是什么,不增不减
getAbsolutePath()返回的其实是user.dir+getPath()的内容,从上面F:\eclipseworkspace\testejb、F:\eclipseworkspace\testejb\..\src\test1.txt、F:\eclipseworkspace\testejb\.\test1.txt可以得出。
getCanonicalPath()返回的就是标准的将符号完全解析的路径


 

 

http://www.shuangfujiaoyu.com/news/24754.html

相关文章:

  • 做网站开发哪里可以接单企业网站seo诊断报告
  • 做前端网站用什么工具百姓网
  • 合肥网站建设讯息郑州seo优化服务
  • php和html5做网站首码项目推广平台
  • 地图网站制作广告接单有什么平台
  • 自己做整个网站的流程整合网络营销外包
  • 服务器网站怎么用最近的新闻有哪些
  • 做围棋题网站西安排名seo公司
  • 浅谈海尔的电子商务网站建设百度搜索排名与点击有关吗
  • 武汉做网站hlbzx站长之家是什么网站
  • 手机公司网站建设比较好的软文案例
  • 安庆网站建设为网站推广软件下载
  • 公司对网站排名如何做绩效外媒头条最新消息
  • 做网站在线聊天的模块杭州seo专员
  • 厦门网站制作费用建设网站的十个步骤
  • 成都建设厅网站重庆seo整站优化方案范文
  • 中山做app网站公司杭州seo渠道排名
  • 西数 网站建设网站制作公司
  • 织梦做网站湖南靠谱seo优化
  • 安阳网站推广餐饮营销手段13种手段
  • 做网站推广有啥活动电商的运营模式有几种
  • 东莞网站建设业务的公司长春今日头条新闻
  • flash网站链接怎么做网站策划运营
  • 支付宝怎么做网站维护网络推广产品公司
  • 有个专门做dnf游戏币的网站品牌网络推广外包
  • 北京网站开发公司今天的病毒感染情况
  • 昆明网站排名优化公司起名最好的网站排名
  • ps网站制作教程友链出售
  • wordpress做网站过程制作网页一般多少钱
  • 设计师一般用什么网站企业网站优化技巧