Salem,
j'ai fait l'enum suivant:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 
public enum acl {
    ACL_NONE,
    ACL_SRC_IP,
    ACL_DST_IP,
    ACL_MY_IP;
        /** L'attribut qui contient la valeur associé à l'enum */
        private final int value;
 
        /** Le constructeur qui associe une valeur à l'enum */
        private squid_acl(int value) {
                this.value = value;
        }
 
        /** La méthode accesseur qui renvoit la valeur de l'enum */
        public int getValue() {
                return this.value;
        }
};
et lors de compilation il m'affiche les errurs suivants:
squid_acl.java:2: cannot find symbol
symbol : constructor acl()
location: class acl
ACL_NONE,
^
acl.java:3: cannot find symbol
symbol : constructor acl()
location: class acl
ACL_SRC_IP,
^
acl.java:4: cannot find symbol
symbol : constructor acl()
location: class acl
ACL_DST_IP,
^
acl.java:5: cannot find symbol
symbol : constructor acl()
location: class acl
ACL_MY_IP,
^
alors j'ajoutela ligne suivante:
public acl{}
alors il me déclare le message d'erreur suivant:
acl.java:3: '}' expected
ACL_NONE,
^
je travaille sous linux:opensuse10.3