Files
hello-algo/ja/codes/java/chapter_hashing/built_in_hash.java
Ikko Eltociear Ashimine 954c45864b docs: add Japanese translate documents (#1812)
* docs: add Japanese documents (`ja/docs`)

* docs: add Japanese documents (`ja/codes`)

* docs: add Japanese documents

* Remove pythontutor blocks in ja/

* Add an empty at the end of each markdown file.

* Add the missing figures (use the English version temporarily).

* Add index.md for Japanese version.

* Add index.html for Japanese version.

* Add missing index.assets

* Fix backtracking_algorithm.md for Japanese version.

* Add avatar_eltociear.jpg. Fix image links on the Japanese landing page.

* Add the Japanese banner.

---------

Co-authored-by: krahets <krahets@163.com>
2025-10-17 05:04:43 +08:00

38 lines
1.3 KiB
Java

/**
* File: built_in_hash.java
* Created Time: 2023-06-21
* Author: krahets (krahets@163.com)
*/
package chapter_hashing;
import utils.*;
import java.util.*;
public class built_in_hash {
public static void main(String[] args) {
int num = 3;
int hashNum = Integer.hashCode(num);
System.out.println("整数 " + num + " のハッシュ値は " + hashNum + " です");
boolean bol = true;
int hashBol = Boolean.hashCode(bol);
System.out.println("ブール値 " + bol + " のハッシュ値は " + hashBol + " です");
double dec = 3.14159;
int hashDec = Double.hashCode(dec);
System.out.println("小数 " + dec + " のハッシュ値は " + hashDec + " です");
String str = "Hello algorithm";
int hashStr = str.hashCode();
System.out.println("文字列 " + str + " のハッシュ値は " + hashStr + " です");
Object[] arr = { 12836, "Ha" };
int hashTup = Arrays.hashCode(arr);
System.out.println("配列 " + Arrays.toString(arr) + " のハッシュ値は " + hashTup + " です");
ListNode obj = new ListNode(0);
int hashObj = obj.hashCode();
System.out.println("ノードオブジェクト " + obj + " のハッシュ値は " + hashObj + " です");
}
}