MonthDay isAfter() Method in Java with Examples
isAfter() method of the MonthDay class used to check if this MonthDay is after the MonthDay passed as parameter or not. This method returns a boolean value showing the same.
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.
public boolean isAfter(MonthDay other)
Parameters: This method accepts one parameter other which is the other month-day to compare to.
Return value: This method returns true if this MonthDay is after the specified MonthDay else it returns false.
Below programs illustrate the isAfter() method:
monthday:--10-12 is after monthday:--11-12 = false
monthday:--10-12 is after monthday:--09-12 = true