Java Object.hashCode()
Syntax
Object.hashCode() has the following syntax.
public int hashCode()
Example
In the following code shows how to use Object.hashCode() method.
/* w w w .jav a 2 s . co m*/
import java.util.GregorianCalendar;
public class Main {
public static void main(String[] args) {
GregorianCalendar cal = new GregorianCalendar();
// print a hashcode for cal
System.out.println(cal.hashCode());
}
}