java.time.MonthDay.with() 方法示例


java.time.MonthDay.with() 方法示例

package com.codingdict;

import java.time.Month;
import java.time.MonthDay;

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

      MonthDay time = MonthDay.parse("--10-15");
      MonthDay result = time.with(Month.APRIL);
      System.out.println(result);  
   }
}