89
Java Date equals() Method
The equals() method of Java Date class returns a Boolean value on the basis of compression between two dates for equality. This method overrides equals in class Object
Syntax:
Parameters
obj – an object to be compared
Return
It returns true if the objects are same otherwise false.
Example 1
Output:
Date 'd' equals Date 'd1' : false
Example 2
Output:
Date 'd' equals Date 'd1' : true
Next Topicjava.util.Date