title: Why are two empty ArrayLists with different generic types equal?
body: <p>I have a doubt regarding how <code>equals()</code> method works for <code>ArrayList</code>. The below code snippet prints <code>true</code>.</p>
  <pre><code>ArrayList&lt;String&gt; s = new ArrayList&lt;String&gt;();
  ArrayList&lt;Integer&gt; s1 = new ArrayList&lt;Integer&gt;();
  System.out.println(s1.equals(s));
  </code></pre>
  <p>Why does it print <code>true</code>?</p>