1.定义常量: public enum Color { RED,ORANGE,YELLOW,GREEN,INDIGO,BLUE,PURPLE } 2.用于switch: enum Color { RED,ORANGE,YELLOW,GREEN,INDIGO,BLUE,PURPLE } public class Draw{ Color c = Color.BLUE; public void draw(){ switch(c){ case RED: c = Color.RED; break; cas…