Year length() example

Description

Year length() gets the length of this year in days.

Syntax

length has the following syntax.


public int length()

Example

The following example shows how to use length.


import java.time.Year;
/*  w  w w. ja v  a2s .  co m*/
public class Main {
  public static void main(String[] args) {
    Year y = Year.of(2014);

    System.out.println(y.length());

  }
}

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