java.time.ZonedDateTime.hashCode()方法

2019-10-16 22:33:45

java.time.ZonedDateTime.hashCode()方法獲取此日期時的雜湊碼。

宣告

以下是java.time.ZonedDateTime.hashCode()方法的宣告。

public int hashCode()

返回值

合適的雜湊碼。

範例

以下範例顯示了java.time.ZonedDateTime.hashCode()方法的用法。

package com.yiibai;

import java.time.ZonedDateTime;

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

      ZonedDateTime date = ZonedDateTime.parse("2017-03-28T12:25:38.492+05:30[Asia/Calcutta]");
      System.out.println(date.hashCode());  
   }
}

編譯並執行上面的程式,這將產生以下結果 -

-957092862