Can Java's hashCode produce same value for different strings?

前端 未结 12 874
情歌与酒
情歌与酒 2020-11-28 08:58

Is it possible to have same hashcode for different strings using java\'s hashcode function?or if it is possible then what is the % of its possibility?

12条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-28 09:45

    "tensada".hashCode()
    "friabili".hashCode());
    

    The java hash function return equal values here.

提交回复
热议问题