GregorianCalendar hashCode() in Java

hashCode(): This method is available in java.util.GregorianCalendar class of Java.

Syntax:

int java.util.GregorianCalendar.hashCode()

This method generates the hash code for this GregorianCalendar object.

Parameters: NA

Returns: a hash code value for this object.

Exceptions: NA

Approach

Java

import java.util.GregorianCalendar;

public class GregorianCalendarhashCode {
    public static void main(String[] args) {

        GregorianCalendar cal = new GregorianCalendar();

        System.out.println(cal.hashCode());
    }
}

Output:

965760340


No comments:

Post a Comment