Java SQL Timestamp after() function with examples
The after() function is a part of Timestamp class of Java SQL.The function returns a boolean value representing whether the Timestamp object occurs after the given Timestamp object .
public boolean after(Timestamp t)
Parameters: The function accepts Timestamp object as parameter which is to be checked.
Return value: The function returns boolean data type representing whether the Timestamp object occurs after the given Timestamp object.
Exception: The function does not throw any exceptions
Below examples illustrate the use of after() function
Example 1: Create two non equal timestamps and check whether the second timestamp occurs after first timestamp or not
Second Timestamp occurs after first timestamp
Example 2: Create two equal timestamps and check whether the second timestamp occurs after first timestamp or not
Second Timestamp does not occur after first timestamp
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.