title: Number of columns in 2d array declaration
body: <p>I want to read a text file and insert it into a 2d array. Here is my code.</p>
  
  <pre><code>        List&lt;String&gt; list2 = new ArrayList&lt;String&gt;();
  
          String thisLine = null;
          while ((thisLine = input1.readLine()) != null) {
          list2.add(thisLine);
          }
  
          double[][] X;
          X = new double[list2.size()][];
  
          String[] temp;
          String delims = ",";
  
          for (int k1 = 0; k1 &lt;= (X.length - 1); k1++) {
              String line = input.readLine();
              temp = line.split(delims);
              for (int i = 0; i &lt; temp.length; i++) {
                  X[k1][i] = Double.parseDouble(temp[i]);
              }
          }
  </code></pre>
  
  <p>The problem is that it returns nothing and as soon as I specify the number of columns in 2d array declaration line, everything is fine. Based on my java knowledge, the number of columns in 2d array declaration is not necessary and in my project (Since we apply different datasets), the number of columns is not specified. </p>