title: Why do my loops stop early when iterating through and array
body: <p>So I am trying to iterate through a 4 by 3 array of objects and set the value of each object according to user input, but I've run into a problem where the iteration through the array stop at 6 instead of the total 12. I've tried a few way of writing the iterators but they always fail. This is the code. </p>
  
  <pre><code>Card[][] field = new Card[3][2];
      void setvals(){
          Scanner scanner = new Scanner(System.in);
          for(int row= 0; row &lt; field.length; row++){
              for(int col = 0; col &lt; field[row].length; col++) {
                  String input = scanner.nextLine();
                  field[row][col] = new Card();
                  field[row][col].makeCard(input);
              }
          }
      }
  </code></pre>
  
  <p>I have also tried &lt;= instead of &lt; but then it gives me array index out of bounds. I have no clue what the problem is.</p>