java.time.YearMonth.with(TemporalField field, long newValue)


java.time.YearMonth.with(TemporalField field, long newValue)

package com.codingdict;

import java.time.YearMonth;
import java.time.temporal.ChronoField;

public class YearMonthDemo {
   public static void main(String[] args) {

      YearMonth date = YearMonth.parse("2017-12");
      YearMonth result = date.with(ChronoField.YEAR,2013);
      System.out.println(result);  
   }
}