Java does this for you by default, it returns .name () in .toString (), you only need to override toString () if you need something different from the name. Interesting methods are: .name () and .ordinal () and .valueOf ().
To do what you want, do
.toString(this.name().substring(1));
Instead, you can add an attribute with the abbreviation and add it to the constructor, add getAbbreviation () and use this instead of .toString ()
source share