Compile Error in java program
<p>I have written following program and program throws compile error as </p>

<p>I don't know why the errors are coming because all semicolons and brackets seem to be in place</p>

<pre><code>import java.io.*;

public class Solution {
  public static void main(String args[]) throws Exception {
    long coords[5000][2];
    long number;
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    try {
      number = Long.parseLong(br.readline());  // take no of inputs
      //take all co ordinates and store it in 2d array
      for(long i=0;i&lt;number;i++) {  
        coords[i][0] = Long.parseLong(br.readline());
        coords[i][1] = Long.parseLong(br.readline());
      }
    } catch(NumberFormatException e) {
      System.out.println("Number Format Exception:");
    }

    if(check_line(coords,number)) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
  }

  public boolean check_line(long coords[][], long limit) {
    long x;

    for(long i=0;i&lt;no;i++) {
      x = coords[i][0];
      if(coords[x][0] == x)
      return true;
      else {
        coords[i][0] = coords[x][0];
        coords[x][0] = x;
      }
    }

    return false;
  }
}
</code></pre>

<p>compile error are as follows: </p>

<pre><code>Solution.java:8: error: ']' expected
long coords[5000][2];
^
Solution.java:8: error: illegal start of expression
long coords[5000][2];
^
Solution.java:8: error: ';' expected
long coords[5000][2];
^ 
Solution.java:8: error: not a statement
long coords[5000][2]; 
^
Solution.java:8: error: ';' expected
long coords[5000][2];
^
</code></pre>
