java.time.YearMonth.range() 方法示例


java.time.YearMonth.range() 方法示例

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("2014-12");
      System.out.println("Range : " + date.range(ChronoField.YEAR_OF_ERA ));
   }
}