java.time.Year.isValidMonthDay() 方法示例 java.time.Year.isSupported(TemporalUnit unit) java.time.Year.length() 方法示例 java.time.Year.isValidMonthDay() 方法示例 package com.codingdict; import java.time.Year; import java.time.MonthDay; public class YearDemo { public static void main(String[] args) { Year date = Year.of(2020); MonthDay monthday = MonthDay.of(12,26); System.out.println(date.isValidMonthDay(monthday)); } } java.time.Year.isSupported(TemporalUnit unit) java.time.Year.length() 方法示例