Get Absolute path of the file - Java File Path IO

Java examples for File Path IO:Path

Description

Get Absolute path of the file

Demo Code

import java.io.*;
 
public class Main {
 
  public static void main(String[] args) {
   //  www  .  j  ava2 s. c  o  m
    String filePath = File.separator + "JavaExamples" + File.separator + "IO";
               
    File file = new File(filePath);
   
     System.out.println("Abstract file path is :" + file.getPath());
     System.out.println("Absolute file path is : " + file.getAbsolutePath());
 
  }
}

Result


Related Tutorials