i have enum defined , able obtain strings individual statuses. how should write such method?
i can int values of statuses option of getting string values ints well.
public enum status { pause(0), start(1), stop(2); private final int value; private status(int value) { this.value = value } public int getvalue() { return value; } }
you can use values() method:
for instance status.values()[0] return pause in case, if print it, tostring() called , "pause" printed.
Comments
Post a Comment