System.getProperty如何设置默认值
导读:当使用System.getProperty获取系统属性时,如果属性不存在,则可以使用第二个参数来设置默认值。例如: String propertyValue = System.getProperty("propertyName", "def...
当使用System.getProperty获取系统属性时,如果属性不存在,则可以使用第二个参数来设置默认值。例如:
String propertyValue = System.getProperty("propertyName", "defaultValue");
如果系统属性"propertyName"不存在,则propertyValue将被设置为"defaultVlaue"。
声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!
若转载请注明出处: System.getProperty如何设置默认值
本文地址: https://pptw.com/jishu/685062.html