Translate days name using ENUM in java

It is possible with enums?

Of course, but not necessary.

Or there is something better solution?

Yes, use the built in functionality. Java already supports representation of dates in human readable form. Use the below code:

DayOfWeek.MONDAY.getDisplayName(TextStyle.FULL, Locale.forLanguageTag("pl-PL"));

It returns:


CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top