Year adjustInto(Temporal temporal) example
Description
Year adjustInto(Temporal temporal)
adjusts the specified temporal object to have this year.
Syntax
adjustInto
has the following syntax.
public Temporal adjustInto(Temporal temporal)
Example
The following example shows how to use adjustInto
.
import java.time.Year;
import java.time.temporal.Temporal;
/* ww w.j av a 2s . c om*/
public class Main {
public static void main(String[] args) {
Year y = Year.of(2014);
Temporal l = y.adjustInto(Year.of(2000));
System.out.println(l);
}
}
The code above generates the following result.