本文主要是介绍Properties作为Map集合,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
package com.itheima_03;
import java.util.Properties;
import java.util.Set;
public class PropertiesDemo01 {
public static void main(String[] args) {
Properties prop = new Properties();
prop.put("itheima001", "林青霞");
prop.put("itheima002", "张曼玉");
prop.put("itheima003", "王祖贤");
Set<Object> keySet = prop.keySet();
for (Object key : keySet) {
Object value = prop.get(key);
System.out.println(key + "," + value);
}
}
}
这篇关于Properties作为Map集合的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!