範例1:枚舉可以直接在switch上使用enum Color { RED, BLUE, GREEN; } public class Demo { public static void main(String[] args) {