enum Gender {
Male,
Female,
};
enum Direction {
Up,
Down
}
enum Episode {
NEWHOPE
EMPIRE
JEDI
}
enum color { red, green, blue=3 };
enum TestEnum : int
{
FOO,
BAR,
BAZ
}
enum Relation {
Smaller
Greater
Equal
}
boolCell
enum true false
enum ExitCode {
Success = 0,
Failure = 1
}
flags
A
B
C
D
// A=1, B=2, C=4, D=8
constants
X
Y
Z
W
// X=0, Y=1, Z=3, W=4
Languages with Enums include C, TypeScript, GraphQL, Chapel, C3, MoonBit, C2, Parsers, Jule, Speedie
Languages without Enums include JavaScript, Python, HTML, CSS, Ruby
View all concepts with or missing a hasEnums measurement
Read more about Enums on the web: 1.