java.time.ZonedDateTime.hashCode() 方法
描述
java.time.ZonedDateTime.hashCode() 方法获取此日期时间的哈希码。
声明
以下是 java.time.ZonedDateTime.hashCode() 方法的声明。
public int hashCode()
返回值
一个合适的哈希码。
示例
下面的例子展示了 java.time.ZonedDateTime.hashCode() 方法的使用。
package com.tutorialspoint;
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

