java.time.Period.withDays() 方法示例


java.time.Period.withDays() 方法示例

package com.codingdict;

import java.time.Period;

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

      Period period = Period.ofDays(2);
      System.out.println(period.toString());  
      period = period.withDays(5);
      System.out.println(period.toString());  
   }
}