Calendar hashCode() Method in Java with Examples
The hashCode() method in Calendar class is used to return the hash code for this Calendar Object.
public int hashCode()
Parameters: The method does not take any parameters.
Return Value: The method returns the hash code value for this calendar object..
Below programs illustrate the working of hashCode() Method of Calendar class:
The time on Calendar shows: Wed Feb 20 15:55:22 UTC 2019 The hash code for this calendar is: 194416203
The time on Calendar shows: Tue Jul 10 00:00:00 UTC 2018 The hash code for this calendar is: -2123101761
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.