title: How to properly check if two jagged arrays are the same size?
body: <p>I am having trouble checking if two jagged java arrays are the same size. My function isn't returning the correct result. The hw problem I'm working on states that the function should return true if both arrays are null or are the same size, and should return false if the only one of the array's is null or if they have a different size. </p>
  
  <p>I have tried executing the code to see what boolean value is returned, however the console outputs nothing. </p>
  
  <pre><code>static boolean arraySameSize(int[][] one, int[][] two) {    
      boolean value = false;
      if (one == null &amp;&amp; two == null) {
          value = true;
      } else if ((one == null &amp;&amp; two != null) || (two == null &amp;&amp; one != null)) {
          value =  false;
      } else {
          int count = 0;
          int count2 = 0;
          for (int i = 0; i &lt; one.length; i++) {
              for (int j = 0; j &lt; one[i].length; j++) {
                  count++;
              }
          }
          for (int i = 0; i &lt; two.length; i++) {
              for (int j = 0; j &lt; two[i].length; j++) {
                  count2++;
              }
          }
          if (count == count2) {
              value = true;
          } else {
              value = false;
          }
      } 
      return value;
  }
  </code></pre>
  
  <p>I expect the output to be true if both array's are null or are the same size, false otherwise. I am getting an error from the auto-grader stating the following: </p>
  
  <p>java.lang.AssertionError: Incorrect result:  expected [false] but found [true]</p>
  
  <p>What should I adjust to ensure that value has the correct value when it's returned?</p>