Adding array to a list in Java
<pre><code>List&lt;double[]&gt; x = new ArrayList&lt;double[]&gt;();
x.add(new double[]={1,2,3,4,54,6});  
</code></pre>

<p>elements 1,2,3,4,54,6 are added to x</p>

<pre><code>x.get(0) ---&gt; returns 1
</code></pre>

<p>But doing this, address of array is added? why</p>

<pre><code>     List&lt;double[]&gt; x = new ArrayList&lt;double[]&gt;();
    double[] name=new double[5];
    name[0]=1
    name[1]=3;
    name[2]=3;
        .
        . 
        . 
        .
    x.add(name);
    getting x.get(0) ---&gt; returns @as12cd2 (address of the array)
</code></pre>
