title: How to put a value into the shortest row of a 2 dimensional array java
body: <p>So basically what I am doing is trying to assign a new Object into the shortest row of a 2-Dimensional Array, the shortest row is determined by a feature of the object stored in the array(in this case minutes) I already have a method that sums the min's up for each individual row of the array but I believe my if statements are off. any advice or ideas would be great.</p>
  
  <p>Here is what I have so far</p>
  
  <pre><code>public static boolean addCustomer(TattooCustomer [][] a, TattooCustomer c) 
  {
      boolean x=false;
      for(int row=0; row&lt;a.length-1; row++)
      {
          for(int col=0; col&lt;a[row].length; col++)
          {
              if((computeMinutesOfWork(a[row])&lt;computeMinutesOfWork(a[row+1]))&amp;&amp;(a[row][col]==null))
              {
                  a[row][col] = c;
                  x = true;
              }
              else if((computeMinutesOfWork(a[row])&lt;computeMinutesOfWork(a[row+1]))&amp;&amp;(a[row][col]!=null)&amp;&amp;(a[row+1][col]==null))
              {
                  a[row+1 ][col] = c;
                  x = true;
              }
  
  
              else
              {
                  x = false;
              }
          }
      }
      return x;
  }
  </code></pre>
  
  <p>}</p>