集合之Properties
作者:互联网
集合之Properties
以下代码使用Properties来存取键值对:
package com.javalearn.map.properties;
import java.util.Properties;
public class TestForPro {
public static void main(String[] args) {
Properties p = new Properties();
p.setProperty("name","cxf"); // 存,只能存String,String
p.setProperty("passwd","smf");
System.out.println(p.getProperty("name")); // 取
}
}
输出结果:
cxf
标签:String,Properties,setProperty,cxf,集合,public,name 来源: https://www.cnblogs.com/cxf-tech/p/15675225.html