Let's say I have a constants class containing 200+ static fields :
class AnimalConstants {
static final int AARDVARK = 1;
static final int ANTELOPE = 2;
static final int BEAR = 3;
...
...
static final int ZEBRA = 200;
}
- Can anyone explain if there are any negative impact on performance and memory from using such classes.
- Would it be better or worse if the class is changed to an interface (e.g. SwingConstants) and being implemented by some classes?
- Would it be better or worse if I implement the constants as an Enum class?