title: Error: Syntax error on token(s), misplaced construct(s) on my array code
body: <p>I'm learning programming and I was working on arrays, but in this method (which is in a class) for some reason when it compiles it shows me a "Error: Syntax error on token(s), misplaced construct(s)" message.</p>
  
  <p>This is the code:</p>
  
  <pre><code>    public int[] ByN(int[] vector){
        int Blancas = 0;
        int Negras = 0;
        int[] ByN = new int[2];
        combinacion temporal = new combinacion(tamlog);
  
        temporal.copiar(vec);
  
        for (int i = 0; i &lt; tamfisico; i++){
          int j = 0;
          Boolean Tof=false;
  
          While ((ToF == false) &amp;&amp; (j &lt; tamfisico);){
            if (vector[i] == temporal[j]){
               Blancas ++;
               temporal.borrar(j);
               j--;
               t--;
               ToF= true;
            }
            j++;
           }
        }
  
  
        for (int i = 0; i &lt; tamlog; i++){
          if (vec[i]== vector[i])
            Negras++;
       }
        Blancas = Blancas - Negras;
        ByN[0]= Blancas;
        ByN[1] = Negras;
        return ByN;
       }
  </code></pre>
  
  <p>It is meant to consider 2 int arrays and count how many are in both - how many are in the exact same position.</p>
  
  <p>The problem seems to be in the first for not sure why...</p>