The values ββin my enum are words that must have spaces in them, but enumerations cannot have spaces in their meanings, so they are all grouped. I want to override toString() to add these spaces where I say.
I also want the enum to provide the correct enum when I use valueOf() on the same line where I added the spaces.
For example:
public enum RandomEnum { StartHere, StopHere }
Call toString() on RandomEnum , the value of which StartHere returns the string "Start Here" . Calling valueOf() on the same line ( "Start Here" ) returns the value of the StartHere enumeration.
How can i do this?
java tostring override enums
WildBamaBoy Mar 12 2018-12-12T00: 00Z
source share