- java.time 包类
- java.time - 主页
- java.time - 时钟
- java.time - 时段
- java.time - Instant
- java.time - LocalDate
- java.time - LocalDateTime
- java.time - LocalTime
- java.time - MonthDay
- java.time - OffsetDateTime
- java.time - OffsetTime
- java.time - Period
- java.time - Year
- java.time - YearMonth
- java.time - ZonedDateTime
- java.time - ZoneId
- java.time - ZoneOffset
- java.time 包枚举
- java.time - Month
- java.time 有用资源
- java.time - 讨论
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
广告