I have this enum type method, right now it returns one color as an int for each option but I want each option to return one color as an int and one string. Here is what I have, I would really appreciate some help so that it will also return a string value:
enum Direction {
NORHT(Color.RED), SOUTH(Color.YELLOW);
Direction(int c) {
color = c;
}
private int color;
public int getColor() {
return color;
}
}
So how could I edit this to also return a sting let say "getting colder" for north and "getting warmer" for south?
Its this line Im having tourble with, not sure where to add the string.
Thanks for the help in advance.
0 comments:
Post a Comment