本文翻译自:Declaring an unsigned int in Java
Is there a way to declare an unsigned int in Java? 有没有办法在Java中声明一个无符号的int?
Or the question may be framed as this as well: What is the Java equivalent of unsigned? 或也可以这样构想这个问题:Java的unsigned等同于什么?
Just to tell you the context I was looking at Java's implementation of String.hashcode()
. 只是为了告诉您上下文,我正在查看Java的String.hashcode()
。 I wanted to test the possibility of collision if the integer were 32 unsigned int. 我想测试整数是否为32 unsigned int时发生冲突的可能性。
#1楼
参考:https://stackoom.com/question/fLWA/在Java中声明一个unsigned-int