Many types of enum used in my program. Most of them use special character or words beginning with numbers. So I have to add a string field and implment the constructor and toString fucntion for everyone.
public enum Money {
OneDollar("1$"),
HundredDollars("100$");
private String value;
private Money(String value) {
this.value = value;
}
public String toString() {
return this.value;
}
}
Is there a simple way to reuse the same field and functions?