java:枚举
package com.javaSE; public class Test { public static void main(String[] args) { Colors colors; colors = Colors.BLUE; System.out.println(colors); /*for(Colors c:Colors.values()){ System.out.println(c); } System.out.println("value of: "+Colors.RED);*/ } public static Colors getCorlor(){ return Colors.RED; } }