Year isLeap(long year) example

Description

Year isLeap(long year) checks if the year is a leap year, according to the ISO proleptic calendar system rules.

Syntax

isLeap has the following syntax.


public static boolean isLeap(long year)

Example

The following example shows how to use isLeap.


import java.time.Year;
/* w w  w.j  a  v a  2 s .  c  o m*/
public class Main {
  public static void main(String[] args) {

    System.out.println(Year.isLeap(2014));

  }
}

The code above generates the following result.





















Home »
  Java Date Time »
    java.time Reference »




Clock
DayOfWeek
Duration
Instant
LocalDate
LocalDateTime
LocalTime
Month
MonthDay
OffsetDateTime
OffsetTime
Period
Year
YearMonth
ZonedDateTime
ZoneId
ZoneOffset