title: How to make HashMap work with Arrays as key?
body: <p>I am using boolean arrays as keys for a HashMap. But the problem is HashMap fails to get the keys when a different array is passed as key, although the elements are same. (As they are different objects). </p>
  
  <p>How can I make it work with arrays as keys ? 
  Here is the code :</p>
  
  <pre><code>public class main {
  public static HashMap&lt;boolean[], Integer&gt; h;
  
  
  public static void main(String[] args){
      boolean[] a = {false, false};
  
      h = new HashMap&lt;boolean[], Integer&gt;();
      h.put(a, 1);
  
  
      if(h.containsKey(a)) System.out.println("Found a");
  
      boolean[] t = {false, false};
  
      if(h.containsKey(t)) System.out.println("Found t");
      else System.out.println("Couldn't find t");
  
  }
  
  }
  </code></pre>
  
  <p>Both the arrays <code>a</code> and <code>t</code> contain the same elements, but HashMap doesn't return anything for <code>t</code>. </p>
  
  <p>How do I make it work ?</p>