Year minus(TemporalAmount amountToSubtract) example
Description
Year minus(TemporalAmount amountToSubtract)
returns a copy of this year with the specified amount subtracted.
Syntax
minus
has the following syntax.
public Year minus(TemporalAmount amountToSubtract)
Example
The following example shows how to use minus
.
import java.time.Period;
import java.time.Year;
/* ww w . j a va2s . c om*/
public class Main {
public static void main(String[] args) {
Year y = Year.of(2014);
Year l = y.minus(Period.ofYears(12));
System.out.println(l);
}
}
The code above generates the following result.