package hashmap_1;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
// HashMap<String,double> hashMap = new
// HashMap<String,double>();///Syntax error on token "double",
// Dimensions expected after this token
HashMap<String, Double> hashMap = new HashMap<String, Double>();
hashMap.put("aa", 90.0);
hashMap.put("bb", 80.0);
hashMap.put("cc", 70.0);
Iterator iter = hashMap.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry) iter.next();
Object key = entry.getKey();
Object value = entry.getValue();
System.out.println(key + ":" + value);
}
}
}
aa:90.0
bb:80.0
cc:70.0