Java Date Time - Java Date.hashCode()








Syntax

Date.hashCode() has the following syntax.

public int hashCode()

Example

In the following code shows how to use Date.hashCode() method.

/*from   ww w  .ja v a  2 s  .co m*/


import java.util.*;

public class Main {

   public static void main(String[] args) {

      Date date = new Date();

      int i = date.hashCode();
      System.out.println( i);
   }
}

The code above generates the following result.