集册 Java实例教程 构造文件路径

构造文件路径

欢马劈雪     最近更新时间:2020-01-02 10:19:05

399
构造文件路径


import java.io.*;

 
 /*
 n o w j a v a . c o m
 */

public class Main {

  public static void main(String[] args) {

     String filePath = File.separator + "JavaExamples" + File.separator + "IO";

    File file = new File(filePath);

   

    System.out.println("File path is : " + file.getPath());

  }

}