YearMonth isLeapYear() method in Java with Examples
The isLeapYear() method of YearMonth class in Java is used to check if the year in this YearMonth object is a leap year or not.
According to the proleptic calendar system rules, a year is a Leap year if:
- If it is divisible by 4.
- It is not divisible by 100 but it can be divisible by 400.
public boolean isLeapYear()
Parameter: This method does not accepts any parameter.
Return Value: It returns a boolean True value if the value of year in this YearMonth object is a leap year according to the proleptic calendar system rules, otherwise it returns False.
Below programs illustrate the isLeapYear() method of YearMonth in Java: