举例:判断返回值是否是枚举值类型
public class Test {
public enum ColorSelect {
red, green, yellow, blue;
}
private static ColorSelect getE()
{
ColorSelect c=ColorSelect.blue;
return c;
}
public static void main(String[] args) {
Object o=getE();
if(o instanceof Enum)
{
System.out.println(o);
}
}
}