java.time.YearMonth.isSupported(TemporalUnit unit) java.time.YearMonth.isSupported() 方法示例 java.time.YearMonth.isValidDay() 方法示例 java.time.YearMonth.isSupported(TemporalUnit unit) package com.codingdict; import java.time.YearMonth; import java.time.temporal.ChronoUnit; public class YearMonthDemo { public static void main(String[] args) { YearMonth date = YearMonth.of(2020,11); System.out.println(date.isSupported(ChronoUnit.ERAS)); } } java.time.YearMonth.isSupported() 方法示例 java.time.YearMonth.isValidDay() 方法示例