public enum Colors extends Enum<Colors>
Enum Constant and Description |
---|
BLUE |
GREEN |
ORANGE |
RED |
WHITE |
YELLOW |
Modifier and Type | Field and Description |
---|---|
private int |
color |
Modifier and Type | Method and Description |
---|---|
int |
getValue() |
static Colors |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Colors[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Colors WHITE
public static final Colors YELLOW
public static final Colors RED
public static final Colors BLUE
public static final Colors GREEN
public static final Colors ORANGE
public static Colors[] values()
for (Colors c : Colors.values()) System.out.println(c);
public static Colors valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int getValue()