java.time.YearMonth.minus() 方法示例 java.time.YearMonth.lengthOfYear() 方法示例 java.time.YearMonth.minus(TemporalAmount amountToSubtract) java.time.YearMonth.minus() 方法示例 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(2017,12); System.out.println(date.minus(2,ChronoUnit.YEARS)); } } java.time.YearMonth.lengthOfYear() 方法示例 java.time.YearMonth.minus(TemporalAmount amountToSubtract)