Home » questions » System.getProperty in java ?
System.getProperty in java ?
getProperty
public static String getProperty(String key)Gets the system property indicated by the specified key.
First, if there is a security manager, its checkPropertyAccess method is called with the key as its argument. This may result in a SecurityException.
If there is no current set of system properties, a set of system properties is first created and initialized in the same manner as for the getProperties method.
Parameters:
key - the name of the system property.
Returns:
the string value of the system property, or null if there is no property with that key.
Throws:
SecurityException - if a security manager exists and its checkPropertyAccess method doesn't allow access to the specified system property.
NullPointerException - if key is null.
IllegalArgumentException - if key is empty.
According to java docs.
Now what is the difference between setProperty(String key, String value) and getProperty(). Please help with a small code ?
K Banerjee

Answers
puckstorm
On 2006-08-16 05:50:46