To get path to file in Java, we are using getAbsolutePath from File:


File myFile = File("c:\\first\\second\\3t\\myFile.txt");
System.out.println(myFile.getAbsolutePath());