java.util.SimpleTimeZone.hashCode() Method

Advertisements


Description

The hashCode() method is used to generate the hash code for the SimpleDateFormat object.

Declaration

Following is the declaration for java.util.SimpleTimeZone.hashCode() method.

public int hashCode()

Parameters

  • NA

Return Value

The method call returns the hash code for this object.

Exception

  • NA

Example

The following example shows the usage of java.util.SimpleTimeZone.hashCode()

package com.tutorialspoint;

import java.util.*;

public class SimpleTimeZoneDemo {
   public static void main( String args[] ){
      // create simple time zone object 
      SimpleTimeZone stobj = new SimpleTimeZone(820,"US");
      
      // get hash code
      int hashcode=stobj.hashCode();
      
      // check hash code value       
      System.out.println("Hash code is : " + hashcode);
   }     
}

Let us compile and run the above program, this will produce the following result.

Hash code is : 820



Advertisements
Advertisements