Java Date Time - LocalDate isAfter(ChronoLocalDate other) example








LocalDate isAfter(ChronoLocalDate other) checks if this date is after the specified date.

Syntax

isAfter has the following syntax.

public boolean isAfter(ChronoLocalDate other)

Example

The following example shows how to use isAfter.

import java.time.LocalDate;
/*from   www .  ja  va 2 s  .com*/
public class Main {
  public static void main(String[] args) {
    LocalDate a = LocalDate.of(2014, 6, 30);
    LocalDate b = LocalDate.of(2014, 7, 1);
    System.out.println(a.isAfter(b)); 
    System.out.println(a.isAfter(a)); 
    System.out.println(b.isAfter(a)); 
  }
}

The code above generates the following result.