title: Syntax error on token "=", Expression expected after this token
body: <p>I am getting an error message which i do not under stand, my code is as follows:</p>
  
  <pre><code>public void generate2DArray(ArrayList&lt;String&gt; mapArray, int lineNumber)
  {
      lineNumber = lineNumber - 2;
      String [] elementSplit = null;
      char TwoDArray [][] = new char[lineNumber][];
      for(int i = 0; i &lt; mapArray.size(); i++){
          elementSplit = (mapArray.get(i)).split("(?!^)");
          for(int j = 0; j &lt; elementSplit.length; j++){
              TwoDArray [i][j] = [i][elementSplit[j]];
          }
          System.out.println(Arrays.toString(elementSplit));
      }
  }
  </code></pre>
  
  <p>The error occurs during:</p>
  
  <pre><code>TwoDArray [i][j] = [i][elementSplit[j]];
  </code></pre>
  
  <p>Where i get the following error:</p>
  
  <pre><code>Syntax error on token "=", Expression expected after this token
  </code></pre>
  
  <p>Can anyone advise on this?</p>
  
  <p>Thanks very much.</p>