Javatpoint Logo
Javatpoint Logo

Java Timestamp before() Method

The before() method of Timestamp class returns Boolean value true if this Timestamp object is earlier than given Timestamp object.

Syntax

Parameters

The parameter 'ts' represents the Timestamp to compare with.

Returns

The before() method of Timestamp class returns :

  • Boolean value true if this Timestamp object is earlier than given Timestamp object.
  • Else, it returns false.

Example 1

Test it Now

Output:

Boolean value returned : true

Example 2

Test it Now

Output:

Reema is greater than Geetanjali
Next TopicJava Timestamp





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA