Files
hello-algo/ja/codes/kotlin/chapter_hashing/built_in_hash.kt
T
Yudong Jin d7b2277d2b Re-translate the Japanese version (#1871)
* Retranslate Japanese docs with GPT-5.4

* Retranslate Japanese code with GPT-5.4
2026-03-30 07:30:15 +08:00

36 lines
965 B
Kotlin

/**
* File: built_in_hash.kt
* Created Time: 2024-01-25
* Author: curtishd (1023632660@qq.com)
*/
package chapter_hashing
import utils.ListNode
/* Driver Code */
fun main() {
val num = 3
val hashNum = num.hashCode()
println("整数 $num のハッシュ値は $hashNum")
val bol = true
val hashBol = bol.hashCode()
println("真偽値 $bol のハッシュ値は $hashBol")
val dec = 3.14159
val hashDec = dec.hashCode()
println("小数 $dec のハッシュ値は $hashDec")
val str = "Hello アルゴリズム"
val hashStr = str.hashCode()
println("文字列 $str のハッシュ値は $hashStr")
val arr = arrayOf<Any>(12836, "シャオハー")
val hashTup = arr.contentHashCode()
println("配列 ${arr.contentToString()} のハッシュ値は $hashTup")
val obj = ListNode(0)
val hashObj = obj.hashCode()
println("ノードオブジェクト $obj のハッシュ値は $hashObj")
}