我正在使用Property对象,我有以下内容:
m_Properties.stringPropertyNames() //A set of Strings that I want to use as the key
m_Properties.values() //A set of Strings that I want to use as the value
我想把它们放在这个hashmap
中 private static HashMap<String, String> newProperties = new HashMap<String, String>();
我不确定因为我必须在同一时间遍历两者,但我该怎么做?
答案 0 :(得分:1)
丑陋的古代物体....
for(String property : m_Properties.stringPropertyNames()) {
newProperties.put(property, m_properties.getProperty(property));
}