I've used quite a few Java libraries / APIs and noticed static final
's are used everywhere, for example within Android.
Why is this? I know you can quickly |
flags together, which can be useful, but you can equally use an EnumSet
.
Another problem I have especially with android is there being loads of unscoped flags, which would be cleaner with enums. For example
You also then can't confuse a set of enums from one class with another, as you can with static final int
s