In Java, an enum is a special data type that allows you to define a set of constants. Nested enum types, also known as inner enum types, are enum
types that are defined within another class or interface.
Nested enum types are implicitly static, so there is no need to declare them static
explicitly.
Noncompliant code example
public class Flower {
static enum Color { // Noncompliant; static is redundant here
RED, YELLOW, BLUE, ORANGE
}
// ...
}
Compliant solution
public class Flower {
enum Color { // Compliant
RED, YELLOW, BLUE, ORANGE
}
// ...
}