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); } }
Australia
UK
UAE
Singapore
Canada
New
Zealand
Malaysia
USA
India
South
Africa
Ireland
Saudi
Arab
Qatar
Kuwait
Hongkong
Copyright 2016-2023 www.programmingshark.com - All Rights Reserved.
Disclaimer : Any type of help and guidance service given by us is just for reference purpose. We never ask any of our clients to submit our solution guide as it is, anywhere.