MonthDay atYear() method in Java with Examples
The atYear() method of MonthDay class in Java combines this month-day with a year to create a LocalDate.
public LocalDate atYear(int year)
Parameter: This method accepts a parameter year which specifies the year to use which is in range [MIN_YEAR, MAX_YEAR]
Returns: The function returns the local date formed from this month-day and the specified year, not null.
Below programs illustrate the MonthDay.atYear() method:
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.