having trouble SUM PER ROW
<p>Im having trouble on my code, I want to print it ROW by Row but I ended up adding all those numbers-</p>

<p>Should look like this --> sum of row 0 is ""
                          sum of row 1 is ""
                          sum of row 2 is ""</p>

<pre><code>public class NewClass
{
          public static void main( String[] arg )
          {
           int[][] data = 
            { { 1, 2},
              { 2, 2},
              { 1, 2, 4, 5},
              { 2, 2, 4,},
              { 1, 1, 4, 5 },
              { 2, 1}};

               int sum = 0;

               for ( int row=0; row &lt; data.length; row++)
                 for ( int col=0; col &lt; data[row].length; col++)
                   sum = sum + data[row][col];

                System.out.println( sum );
              }
}
</code></pre>
