Java Date Time Java Java API
java.time.YearMonth
public boolean isAfter(YearMonth other)
Checks if this year-month is after the specified year-month.
package com.logicbig.example.yearmonth;import java.time.YearMonth;public class IsAfterExample { public static void main(String... args) { YearMonth y1 = YearMonth.of(2010, 11); System.out.println(y1); YearMonth y2 = YearMonth.of(2000, 5); System.out.println(y2); boolean b = y1.isAfter(y2); System.out.println(b); boolean b2 = y2.isAfter(y1); System.out.println(b2); }}
2010-112000-05truefalse