How to multiply two values with the same key name from different linkedHashMaps?
<p>I have two linkedHashmaps which are the same length with the same key names but the values are different. for example :</p>

<pre><code>Map&lt;String, Double&gt; map1= new LinkedHashMap&lt;String, Double&gt;(); 

map1.put("A", 2.3);    
map1.put("B", 6.1);
map1.put("C", 5.3);

Map&lt;String, Double&gt; map2= new LinkedHashMap&lt;String, Double&gt;(); 

map2.put("A", 10.3);    
map2.put("B", 60.1);
map2.put("C", 0.3);
</code></pre>

<p>How would I multiply each value from map1 with the same corresponding key in       map2 (A 2.3*10.3, B 6.1*60.1 etc etc) and save the results to a new linkedHashMap? </p>

<p>I tried this with no luck.</p>

<pre><code>Map&lt;String, Double&gt; map3= new LinkedHashMap&lt;String, Double&gt;();
                double valueMap1 = map1.get(key);
                double valueMap2 = map2.get(key1);

            for(String key : map1.keySet())
                for(String key1 : map2.keySet()){
            if(map1.containsKey(key1)){


                double newValue =valueMap1* valueMap2;


                map3.put(key1, newValue);
        }
      }
</code></pre>