java.time.ZoneId.hashCode() 方法示例



說明

java.time.ZoneId.hashCode() 方法獲取此時區 ID 的雜湊碼。

宣告

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

public int hashCode()

返回值

合適的雜湊碼。

示例

以下示例展示了 java.time.ZoneId.hashCode() 方法的用法。

package com.tutorialspoint;

import java.time.ZoneId;

public class ZoneIdDemo {
   public static void main(String[] args) {
 
      ZoneId zone = ZoneId.of("Z");
      System.out.println(zone.hashCode());  
   }
}

讓我們編譯並執行上述程式,它將產生以下結果 −

0
廣告