|
Do you need help with your Java programming?
Click here for instant help with your Java code. |
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(); } } |
| Do you know your Java? | |
| Take a Ten-Question-Java-Quiz! | |
Search for code examples on this site
