How to get all dates of sundays in a particular year in Java?

Create a new calendar. Set the time to 1/1/yyyy and some time. Check if the current date is a Sunday and roll forward one day until it is. That’s the first Sunday of the year. Roll forward 7 days until the year no longer matches, marking as you go.

Leave a Comment