Year MAX_VALUE example

Description

Year MAX_VALUE defines the maximum supported year, '+999,999,999'.

Syntax

MAX_VALUE has the following syntax.


public static final int MAX_VALUE

Example

The following example shows how to use MAX_VALUE.


import java.time.Year;
/*w w w  .jav  a 2s. c  om*/
public class Main {
  public static void main(String[] args) {
    int i = Year.MAX_VALUE;
    System.out.println(i);

  }
}

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