VOOZH about

URL: https://www.geeksforgeeks.org/java/year-isafter-method-in-java-with-examples/

⇱ Year isAfter() method in Java with Examples - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Year isAfter() method in Java with Examples

Last Updated : 27 Nov, 2018
The isAfter() method of Year class in Java is used to check if this current Year object is after the Year specified as parameter to this method. Syntax:
public boolean isAfter(Year otherYear)
Parameter: It accepts a single parameter otherYear with which the current Year object is to be compared. Return Value: It returns a boolean True value if this Year object's value is after the value of Year object specified as a parameter to the method, otherwise it returns False. Below programs illustrate the isAfter() method of Year in Java: Program 1:
Output:
true
Program 2:
Comment