Year isValidMonthDay(MonthDay monthDay)
checks if the month-day is valid for this year.
isValidMonthDay
has the following syntax.
public boolean isValidMonthDay(MonthDay monthDay)
The following example shows how to use isValidMonthDay
.
import java.time.Month; import java.time.MonthDay; import java.time.Year; // www .j ava2 s . co m public class Main { public static void main(String[] args) { Year y = Year.of(2014); System.out.println(y.isValidMonthDay(MonthDay.of(Month.APRIL,1))); } }
The code above generates the following result.