【综合练习1】彩虹枚举
编写一个彩虹枚举,枚举中有“红橙黄绿蓝靛紫”7种颜色。
/*【综合练习1】彩虹枚举
* 编写一个彩虹枚举,枚举中有“红橙黄绿蓝靛紫”7种颜色。
* */
package mjlxhfx;
enum Rainbow{
RED,ORANGE,YELLOW,GREEN,BLUE,INDIGO,PURPLE
}
public class Zhlx1 {
public static void main(String[] args) {
// TODO 自动生成的方法存根
}
}
Red:红
Orange:橙
Yellow:黄
Green:绿
Blue:青
Indigo:蓝
Purple:紫