Get List of Weekday Names in Java

In this post, we will see how to get list of weekday names in Java.

Using DateFormatSymbols’s getWeekdays() method

We can use DateFormatSymbols's getWeekdays() to get list of weekday names in Java. It will provide complete weekday names like Sunday, Monday etc.

Output

Using DateFormatSymbols’s getShortWeekdays() method [For short names]

If you need short names rather than complete weekdays name, you can use DateFormatSymbols's getShortWeekdays().

Output

Using DateFormatSymbols’s getWeekdays() with Locale

If you are looking for weekday names in different Locale like German or French, you can specify Locale while creating object of DateFormatSymbols. It will work for both methods i.e. getWeekdays() and getShortWeekdays().

Output

That’s all about how to get list of months in Java.

Was this post helpful?

Leave a Reply

Your email address will not be published. Required fields are marked *