Hashcode of an int

后端 未结 4 1231
[愿得一人]
[愿得一人] 2020-12-09 02:34

What is the hashcode of a primitive type, such as int?

for example, let\'s say num was an interger.

int hasCode = 0;

if (num != 0) {
  hasCode = has         


        
4条回答
  •  臣服心动
    2020-12-09 03:34

    No hashCode() method for primitive type int available.

    Integer is Wrapper class type and hashcode() returns an int

提交回复
热议问题