My suggestion is to keep the constants as close to their usage as possible
Yes, of course, that is true, and in such cases the usage is typically local or within the class itself. In these cases, it makes perfect sense to define constants using public static finalwithin the classes they're being used. I, however, have encountered lots of usages of constants which are being shared across classes, and that is the point I was referring to.
Of course, constant interface shouldn't be implemented, and if someone really does that, one should have a quiet word with them in private :P
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Yes, of course, that is true, and in such cases the usage is typically local or within the class itself. In these cases, it makes perfect sense to define constants using
public static final
within the classes they're being used. I, however, have encountered lots of usages of constants which are being shared across classes, and that is the point I was referring to.Of course, constant interface shouldn't be implemented, and if someone really does that, one should have a quiet word with them in private :P