I have some C++ code that looks like this:
enum {
FOO = 0x01,
BAR = 0x09;
};
switch (baz) {
case FOO:
{
//...
}
break;
case BAR:
{
//...
}
break;
}
Is it possible to replicate this behaviour in Java?
Yes, Java has enums: