• [^] # Re: Bah

    Posté par . En réponse au message règles syntaxiques. Évalué à 1.

    je viens en effet de lire cette section et c'est bien ce qu'il me faut.
    mais je ne suis pas d'accord avec toi:

    en effet,
    Letters and digits may be drawn from the entire Unicode character set, which supports most writing scripts in use in the world today, including the large sets for Chinese, Japanese, and Korean. This allows programmers to use identifiers in their programs that are written in their native languages.


    mais par contre :
    Identifier:
    IdentifierChars but not a Keyword or BooleanLiteral or NullLiteral

    IdentifierChars:
    JavaLetter
    IdentifierChars JavaLetterOrDigit


    et là, justement,
    The Java letters include uppercase and lowercase ASCII Latin letters A-Z (\u0041-\u005a), and a-z (\u0061-\u007a), and, for historical reasons, the ASCII underscore (_, or \u005f) and dollar sign (,ドル or \u0024).


    donc pour un identifiant, on n'a pas le droit au 'letters' mais seullement au sous ensemble 'JavaLetter'.

    et chez moi:
    bash-2.05b$ cat ./test.java
    class Test {
    int é = 0;
    public static void main (java.lang.String[] args)
    {}
    }
    bash-2.05b$
    bash-2.05b$ javac ./test.java
    ./test.java:2: illegal character: 65533円
    int ? = 0;
    ^
    1 error
    bash-2.05b$


    En fait, je suis étonné que chez toi ça compile ... c'est quelle version de java ?
    bash-2.05b$ java -version
    java version "1.4.2_06"