Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

in Eclipse, define nested class

Tags:

java

class

nested

I am trying to define a nested class using Eclipse....

public class Xxx {

    private boolean[][] grid;
    private boolean OPEN = true;
    private Site[][] s;

    class Site() {

        private int val;

        Site() {               // empty constructor


        }
    }

    public Xxx(int N) {

........
    }
.......
}

On the line defining the inner class, Site, I get an error...

Multiple markers at this line - Syntax error on token "class", @ expected - Syntax error, insert "}" to complete Block

Is my syntax wrong? I don't understand the message.

like image 783
Dr.COM Avatar asked Sep 08 '14 08:09

Dr.COM


1 Answers

Remove the ():

class Site {
    // ...
}
like image 137
ToasteR Avatar answered Sep 23 '22 09:09

ToasteR