How can I combine two HashMap objects containing the same types?

map3 = new HashMap<>();

map3.putAll(map1);
map3.putAll(map2);

Leave a Comment