--------------1:
public class enuml {
public enum Color{
RED,BLUE,BLACK,YELLOW,GREEN
}
public static void main(String[] args) {
Color color=Color.BLUE;
switch(color){
case RED: System.out.println("it's red");break;
case BLUE: System.out.println("it's blue");break;
case BLACK: System.out.println("it's blue");break;
}
}
}
public class enuml {
public enum Color{
RED,BLUE,BLACK,YELLOW,GREEN
}
public static void main(String[] args) {
Color color=Color.BLUE;
switch(color){
case RED: System.out.println("it's red");break;
case BLUE: System.out.println("it's blue");break;
case BLACK: System.out.println("it's blue");break;
}
}
}
-------------------------------------------
it's blue
-------------------------------------------------------------------------2: