Adding values to Arraylist
<p>Code 1:</p>

<pre><code>ArrayList arr = new ArrayList();
arr.add(3);
arr.add("ss");
</code></pre>

<p>Code 2:</p>

<pre><code>ArrayList&lt;Object&gt; arr = new ArrayList&lt;Object&gt;();
arr.add(3);
arr.add("ss");
</code></pre>

<p>Code 3:</p>

<pre><code>ArrayList&lt;Object&gt; arr = new ArrayList&lt;Object&gt;();
arr.add(new Integer(3));
arr.add(new String("ss"));
</code></pre>

<p>all the above three codes are working fine.. can some one tell me the which is prefered and why.. and why the eclipse compiler always gives warning when type of arguments are not mentioned to the Arraylist..   thanks in advance..</p>
