Construct file path - Java File Path IO

Java examples for File Path IO:Path

Description

Construct file path

Demo Code


import java.io.*;
 
public class Main {
  public static void main(String[] args) {
     String filePath = File.separator + "JavaExamples" + File.separator + "IO";
    File file = new File(filePath);
   /*  w w  w  . j a v  a 2 s  .com*/
    System.out.println("File path is : " + file.getPath());
  }
}

Result


Related Tutorials