Java Date Time - LocalDate isLeapYear() example








LocalDate isLeapYear() checks if the year is a leap year, according to the ISO proleptic calendar system rules.

Syntax

isLeapYear has the following syntax.

public boolean isLeapYear()

Example

The following example shows how to use isLeapYear.

import java.time.LocalDate;

public class Main {
  public static void main(String[] args) {
    LocalDate a = LocalDate.of(2014, 6, 30);

    System.out.println(a.isLeapYear());
  }
}

The code above generates the following result.