Java Date Time Java Java API
java.time.Year
public boolean isAfter(Year other)
Checks if this year is after the specified year.
package com.logicbig.example.year;import java.time.Year;public class IsAfterExample { public static void main(String... args) { Year y = Year.of(2011); System.out.println(y); Year y2 = Year.now(); System.out.println(y2); boolean b = y2.isAfter(y); System.out.println(b); boolean b2 = y.isAfter(y2); System.out.println(b2); }}
20112017truefalse