Get current directory
This example shows how to get the value of the current directory. It gets the value of a system property called "user.dir"; |
public class FileUtil { public void displayCurrentDir() { System.out.println(System.getProperty("user.dir")); } public static void main(String[] args) { FileUtil fileutil = new FileUtil(); fileutil.displayCurrentDir(); } } |
Search for code examples on this site
