The getproperty() method defined in the Java system class is used to retrieve the value of the property named in the parameter list. This attribute of the method is specified by the key accepted by 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 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); } }