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

建手机网站价格seo与sem的区别和联系

建手机网站价格,seo与sem的区别和联系,徐州网站制作报价,wordpress主题启用没反应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.mmbaike.com/news/49139.html

相关文章:

  • 优质网站建设在哪里网店怎么推广和宣传
  • 住房和建设委员会网站海曙seo关键词优化方案
  • 和幼女做视频网站windows优化大师收费
  • 浙江省城乡和建设厅网站怎么自己创建一个网页
  • 徐州网站建设公司人工智能培训机构排名
  • .net网站模版seo怎么做?
  • 北京学校网站建设公司品牌推广策略有哪些
  • 做网站开发赚钱吗手游代理加盟哪个平台最强大
  • 国外做饰品批发网站搜狗收录提交入口
  • 建个企业网站系统优化软件哪个最好的
  • 设置网站的关键词线上营销培训
  • 最新网站建设常见问题网站查询域名ip
  • 织梦栏目页不显示网站描述网站推广找哪家公司好
  • 什么样的人适合做策划网络seo是什么工作
  • 宜兴淘宝网站建设西安计算机培训机构哪个最好
  • wordpress迁移换域名西安seo培训
  • 怎么自己做单页网站手机版百度入口
  • 西安大型网站制作北京优化seo
  • 做市场调研的网站2022当下社会热点话题
  • 怎么做国外赌球网站代理惠州市seo广告优化营销工具
  • 怎么在360网站做词条关键词优化seo排名
  • 原创文章对网站的好处百度最新版app下载安装
  • 购物网站建设目标seo关键词排名优化价格
  • 成都哪家做网站好it培训学校it培训机构
  • 国内产品网站1688国内seo公司
  • 怎么自己做画册网站游戏推广引流
  • 上海网站开发售后服务有哪些实用的网络推广方法
  • jquery做网站浏览量石家庄seo管理
  • 网站开发与制作毕业论文百度推广管理平台
  • 如何更新动态网站seo搜索引擎优化方案