Return a default value if the specified property does not exist in Java
Description
The following code shows how to return a default value if the specified property does not exist.
Example
// w ww . j a v a2 s . c o m
public class Main {
public static void main(String[] args){
System.out.println(System.getProperty("password","defaultPassword"));
}
}
The code above generates the following result.