bonjour
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
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 
public enum Tuna
{
    bucky("nice", "22"),
    kelsy("cutie", "10"),
    julia("bigmistake", "12"),
    nicole("italien","13"),
    candy("different","14"),
    erin("wish","16");
 
    private final String desc;
    private final String year;
    Tuna(String description,String birthday)
    {
        desc=description;
        year=birthday;
    }
    public String getDesc()
    {
        return desc;
    }
    public String getYear()
    {
        return year;
    }
}
package javaapplication1;
import java.util.EnumSet;
public class Apples
{
 public static void main(String[]args)
   {
       for(Tuna people:Tuna.values())
          System.out.printf("%s\t%s\t%s\n",people,people.getDesc(),people.getYear());
          System.out.printf("\nAnd now for the range of constante!!\n");
 
       for(Tuna people:EnumSet.range(Tuna.kelsey,Tuna.candy))
          System.out.printf("%s\t%s\t%s\n",people,people.getDesc(),people.getYear());
   }
)
Tuna.candy est souligné dans la ligne
for(Tuna people:EnumSet.range(Tuna.kelsey,Tuna.candy))

et indique "can not find symbol symbol:variable kelsey location:class javapplication1.Tuna

en compilant j'ai erreur suivante
bucky nice 22
kelsy cutie 10
julia bigmistake 12
nicole italien 13
candy different 14
erin wish 16

And now for the range of constante!!
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code
at javaapplication1.Apples.main(Apples.java:12)

aidez moi s'il vous plaît