Advertisement
asanchez75

java/hashmap

Sep 17th, 2015
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. HashMap<String, HashMap<String, Double>> collector = new HashMap<String, HashMap<String, Double>>();
  2. collector.put("Artist", new HashMap<String, Double>(){{put("links", 5.0);}});
  3. System.out.println(collector);
  4. double value = collector.get("Artist").get("links");
  5. value = value + 1;
  6. //collector.put("Artist", new HashMap<String, Double>(){{put("links", value);}});
  7. collector.get("Artist").put("links", value);
  8. System.out.println(collector);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement