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



描述

java.time.Year.hashCode() 方法返回此年的哈希码。

声明

以下是 java.time.Year.hashCode() 方法的声明。

public int hashCode()

public int hashCode()

返回值

合适的哈希码。

示例

package com.tutorialspoint;

import java.time.Year;

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

      Year date = Year.of(2017);
      System.out.println(date.hashCode());
   }
}

现场演示

2017
打印页面
广告
© . All rights reserved.