GregorianCalendar.hashCode() has the following syntax.
public int hashCode()
In the following code shows how to use GregorianCalendar.hashCode() method.
//from ww w. ja v a 2s. c o m import java.util.*; public class Main { public static void main(String[] args) { GregorianCalendar cal = (GregorianCalendar) GregorianCalendar.getInstance(); // print a hashcode for this calendar System.out.println("Hash Code:" + cal.hashCode()); } }
The code above generates the following result.