YearMonth isLeapYear()
checks if the year is a leap year, according to the
ISO proleptic calendar system rules.
isLeapYear
has the following syntax.
public boolean isLeapYear()
The following example shows how to use isLeapYear
.
import java.time.YearMonth; /* w w w.j a v a 2 s .c o m*/ public class Main { public static void main(String[] args) { YearMonth y = YearMonth.now(); System.out.println(y.isLeapYear()); } }
The code above generates the following result.