I am looking at some existing (and working) code and came across a line like this:
if (someObject.getStatus() == SomeEnum.VALUE1.VALUE2) { ... }
Where SomeEnum is a simple enumeration that looks like this:
public enum SomeEnum {
VALUE1,
VALUE2,
VALUE3,
...
}
private SomeEnum() {}
Now, what makes this comparison higher? More precisely, what does the combination of the two enum values do? I was surprised not to see any warnings or errors because of this line, as I assumed that it was simply wrong. However, it compiles and works very well. Can someone enlighten me on what this will do?
source
share