 <p>In my opinion you have already discovered a pretty straight forward approach to this problem.</p> <pre><code>HashMap&lt;Integer, String&gt; map = new HashMap &lt;Integer, String&gt;(); int[] keys = {1, 3, 5, 7, 9}; String[] values = {"turtles", "are", "better", "than", "llamas"}; for(int i = 0; i &lt; keys.length; i++){ map.put(keys[i], values[i]); } </code></pre>