"illegal start of expression" en Java

Fermé
cinou - 30 mars 2008 à 15:41
 Utilisateur anonyme - 30 mars 2008 à 17:34
Bonjour,
J'ai construit une classe Test en java pour tester le jeu Othello , et ià la compilation j'ai les erreurs suivantes , que je ne comprend pas du tout!

-------------------------------------------------------------------------------------

TestOthello.java:5: illegal start of expression
private static final int N=8;
^
TestOthello.java:6: illegal start of expression
private static final int CASE_VIDE=0;
^
TestOthello.java:7: illegal start of expression
private static final int JETON_NOIR=1;
^
TestOthello.java:8: illegal start of expression
private static final int JETON_BLANC=2;
^
TestOthello.java:9: illegal start of expression
private static final char [] etiquette ={'A','B','C','D','E','F','G','H
'};
^
TestOthello.java:10: illegal start of expression
private int [][] plateau;
^
TestOthello.java:13: illegal start of expression
public Othello()
^
7 errors
----------------------------------------------------------------------------------------------------

Le code de TestOthello est :


#######################

public class Othello
{
public static void main(String[] args)
{
private static final int N=8;
private static final int CASE_VIDE=0;
private static final int JETON_NOIR=1;
private static final int JETON_BLANC=2;
private static final char [] etiquette ={'A','B','C','D','E','F','G','H'};
private int [][] plateau;
.... etc!

######################


Merci !
ps: je travail sur Cygwin !
A voir également:

1 réponse

Utilisateur anonyme
30 mars 2008 à 17:34
Salut,


Ici (main) tu ne peux mettre que final int N = 8:

Il faut les declarer a un autre endroit, par exemple au niveau classe.

Cordialement, Dan.
2