java.util.Calendar.after() is a method in Calendar class of java.util package. The method returns true if the time represented by this Calendar is after the time represented by when Object. If it is not the case, false is returned.
public boolean after(Object when) Where, when is the Object that is to be compared.
Below are some examples to understand the implementation of the Calendar.after() function in a better way :
Example 1 :
Time 1 : Thu Mar 01 09:26:04 UTC 2018 Time 2 : Thu Mar 01 09:26:04 UTC 2018 false
Example 2 :
Current date is : Thu Mar 01 09:27:19 UTC 2018 Result : true
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.