A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/java/java-program-to-find-current-working-directory/ below:

Java Program to Find Current Working Directory

Java Program to Find Current Working Directory

Last Updated : 29 Oct, 2020

The getproperty() methods defined in System Class in Java which is used to retrieve the value of the property named in the argument list. This method property is specified by the key which accepts the parameter. If the property does not exist, this version of getProperty returns null.


Syntax :

public static String getProperty(String key)

Parameter :

Returns :

Example:

Java
// Java Program to Find 
// current working directory
import java.io.*;

public class GFG {
  
    public static void main(String[] args)
    {

        // Getting the path of system property
        String path = System.getProperty("user.dir");

        // Printing the path of the working Directory
        System.out.println("Working Directory = " + path);
    }
}


Output:



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4