Count(*) like generation from an Array
<pre><code>Orderid     Amount      order id    Amount
c4         1            c2          60
c2         10           c3          38
c2         20           c4          13
c2         30           null           null
c3         11           null           null
c3         13           null           null
c3         14           null           null
c4         12           null           null
</code></pre>

<p>Above are two arrays(order id , Amount) 
The first Array consists of elements containing duplicate orderid's along with their values , i'm trying to find out distinct orderid's along with their sum as shown in the second array . for that i wrote the below code . its not working . Pls help</p>

<pre><code>for(int y=0;y&lt;data.length;y++) {
                  if(data[y][0].equals(data[y+1][0])==true)
                  { 
                      tx=(Double) data[y][1]+(Double)data [y+1][1];

                     data[y+1][1] = tx;
                     data[y][1]=tx;
                     data[y][0]=null;
                  }    
                  if(y+1 &gt; data.length)
                  {
                      break;
                  }
                 System.out.println("Tx="+tx);
                  }
</code></pre>
