title: Loop through an ArrayList of HashMaps Java
body: <pre><code>ArrayList&lt;HashMap&lt;String, Integer&gt;&gt; myList = new ArrayList&lt;HashMap&lt;String, Integer&gt;&gt;();
  
      HashMap&lt;String, Integer&gt; check = new HashMap&lt;String, Integer&gt;();
  </code></pre>
  
  <p>I have some number of hashmaps in my array list and I want to compare the hashmaps for duplicates like this 0,1 0,2 0,3 0,4....1,2 1,3 1,4.....2,3 2,4 etc.</p>
  
  <p>I was doing a nested for loop to so this but got stuck on how to access the hashmaps and tried this </p>
  
  <pre><code>for (int a =0; a&lt;myList.size();a++){
              for(int b=a+1; b&lt;myList.size();b++){
                  for (String key : myList[a].check.keySet())
              }
          }
  </code></pre>
  
  <p>But this does not work. How do I acess all the keys of my hashmap if their in the arraylist? How can I accomplish this?</p>