This commit is contained in:
parent
0396ab6fc7
commit
a4e4c25dcd
@ -1,6 +1,33 @@
|
||||
package C08_Structures_de_donnees.C081_Enum;
|
||||
|
||||
enum Glace {VANILLE, CHOCOLAT, FRAISE, MANGUE};
|
||||
// enum Cat {MINOU, CHATONS, CONNAIS_PAS_D_AUTRES, TOTO};
|
||||
public class App {
|
||||
public static void main(String[] args) throws Exception {
|
||||
System.out.println("Hello, World!");
|
||||
|
||||
Glace favorite = Glace.VANILLE;
|
||||
// Cat simba = Cat.CHATONS;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
switch (favorite) {
|
||||
case VANILLE:
|
||||
System.out.println("Vanille");
|
||||
favorite = Glace.CHOCOLAT;
|
||||
break;
|
||||
|
||||
case CHOCOLAT:
|
||||
System.out.println("Chocolat");
|
||||
favorite = Glace.FRAISE;
|
||||
break;
|
||||
|
||||
case FRAISE:
|
||||
System.out.println("Fraise");
|
||||
favorite = Glace.MANGUE;
|
||||
|
||||
default:
|
||||
System.out.println("Mangue");
|
||||
favorite = Glace.VANILLE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +0,0 @@
|
||||
package C08_Structures_de_donnees.C081_Enum;
|
||||
|
||||
public class Cat {
|
||||
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
package C08_Structures_de_donnees.C081_Enum;
|
||||
|
||||
public class Glace {
|
||||
|
||||
}
|
Reference in New Issue
Block a user