java.time.Year.isSupported() 方法示例 java.time.Year.isLeap() 方法示例 java.time.Year.isSupported(TemporalUnit unit) java.time.Year.isSupported() 方法示例 package com.codingdict; import java.time.Year; import java.time.temporal.ChronoField; public class YearDemo { public static void main(String[] args) { Year date = Year.of(2020); System.out.println(date.isSupported(ChronoField.ERA)); } } java.time.Year.isLeap() 方法示例 java.time.Year.isSupported(TemporalUnit unit)