Java Date Time - MonthDay adjustInto(Temporal temporal) example

MonthDay adjustInto(Temporal temporal) adjusts the specified temporal object to have this month-day.


adjustInto has the following syntax.

public Temporal adjustInto(Temporal temporal)


The following example shows how to use adjustInto.

import java.time.LocalDate;
import java.time.MonthDay;
import java.time.temporal.Temporal;
/*from w w  w  . j  a va 2s  .  co m*/
public class Main {
  public static void main(String[] args) {
    MonthDay m =;
    Temporal n = m.adjustInto(;


The code above generates the following result.