0
public static void main(String[] args) {
    String uuid = null;
    while ((uuid = UUID.randomUUID().toString().replace("-", "")).hashCode() != Integer.MIN_VALUE){};
    System.out.println("i got one! " + uuid);
}

我找不到结果。即使我不知道结果是否存在。帮我。

4

1 回答 1

2

是的,存在一个。事实上,大约一个随机的 UUID2^32将有一个hashcode等于Integer.MIN_VALUE. 如果您运行测试足够长的时间,您会找到一个。

于 2012-07-10T09:14:00.350 回答