Year isAfter(Year other) example

Description

Year isAfter(Year other) checks if this year is after the specified year.

Syntax

isAfter has the following syntax.


public boolean isAfter(Year other)

Example

The following example shows how to use isAfter.


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

    System.out.println(y.isAfter(Year.of(2015)));

  }
}

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