uh, sounds like you want a basic nested loop to iterate across your array...
for(int i=0; i<rows.length; i++)
   for(int j=0; j<columns.length; j++)
This will reset your columns regardless. If you want to do something tricksy and hackish
int sum =0;
for(int i=0; i<rows.length; i++)
{
  sum+= rows[i];
  if(i == rows.length-1 && sum == 0)
  {
     i=i+1
  } 
   for(int j=0; j<columns.length; j++)
   {
     //whatever else you want here
   }
}
Note that this seems like a most unusual condition algorithmically...I hope you're not trying to hack around a dirty bug instead of figuring out what the real problem is!