LocalDate plus(long amountToAdd, TemporalUnit unit) example
Description
LocalDate plus(long amountToAdd, TemporalUnit unit)
returns a copy of
this date with the specified amount added.
Syntax
plus
has the following syntax.
public LocalDate plus(long amountToAdd, TemporalUnit unit)
Example
The following example shows how to use plus
.
import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
/* w w w . j a va 2 s.c om*/
public class Main {
public static void main(String[] args) {
LocalDate a = LocalDate.of(2014, 6, 30);
LocalDate b = a.plus(100,ChronoUnit.DAYS);
System.out.println(b);
}
}
The code above generates the following result.