How to get System.getProperty?

This method returns the value of the specified property.
It returns null if the specified property does not exist.
Each property comes as a key/value pair.
There are system properties and user-defined properties.
When a Java program runs, the JVM provides values that may be used by the program as properties.
For example, the os.name system property provides the name of the operating system running the JVM.
To get the value of the user.dir property, you use:
public class MainClass{

public static void main(String[] args){
System.out.println(System.getProperty (“user.dir”));
}

}

output
C:\users\smith\desktop