I want to get properteis from HashMap.
HashMap<String, Object> getProperties()
I want to get the properties which is true.
I want to get properteis from HashMap.
HashMap<String, Object> getProperties()
I want to get the properties which is true.
Example:
HashMap<String, String> newMap = new HashMap<String, String>();
newMap.put("property", "shhh_secret");
String value = newMap.get("property");
or
Set s = newMap.keySet();
for (Iterator iter = s.iterator(); iter.hasNext()) {
newMap.get(s);
}
or
Iterator iter = newMap.keySet().iterator();
while (iter.hasNext()) {
...
}
This will help to read values from HashMap..Simple example
HashMap<Integer, String> hm = new HashMap<Integer, String>();
hm.put(1, "One");
hm.put(2, "Two");
hm.put(3, "Three");
Set st = hm.entrySet(); //hm.keySet();
for(Iterator itr = st.iterator(); itr.hasNext();)
{
//hm.get(st);
System.out.println(itr.next());
}