I'm a intermediate java programmer who has run into a conundrum.
I'm trying to decide what strategy to use when using fixed in-parameters to certain methods.
e.g. I want to do this:
void aMethod (int i, Color color)
where Color is my own creation.
They way I see it, I can either create an enum Color. I know how to do that.
I can also do this:
public class Color{
public static Color blue = new Color(23, 22, 21);
public static Color red = new Color(12, 32 ,10);
private int a;
private int b;
private int c;
private Color(int a, int b, int c){
this.a = a;
this.b = b;
this.c = c;
}
methods...
The thing is, that after trying both I can do exactly the same thing with them. The only difference is that I feel that my class example is more easily understood, I know exactly what it does. Even though I can write a multifunctional enum, I'm not absolutely sure what variables are static, public, private, etc, nor what kind of memory it will use. It's a little messy.
So, my question to you is, should I go with classes like the above, instead of enums? Are there some things I don't know that might add to Enums' case?