Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Map<String, Double> map1 = new HashMap<>();
- Map<String, Double> map2 = new HashMap<>();
- Map<String, Double> map3 = new HashMap<>();
- map1.put("clave1", 10.0);
- map1.put("clave2", 4.0);
- map2.put("clave1", 10.0);
- map2.put("clave2", 6.0);
- map3= new HashMap(map1);
- map2.forEach((key, value) -> map3.merge(key, value, (v1, v2) -> (v1+v2)/2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement