值不一样HashCode一样的情况

“通话"与"重地”

import org.junit.Test;

public class TestHashCode {
    @Test
    public void test(){
        String str1 = "通话";
        String str2 = "重地";
        System. out. println(str1. hashCode());
        System. out. println(str2. hashCode());
        System. out. println(str1. equals(str2));
    }
}

猜你喜欢

转载自blog.csdn.net/weixin_44371237/article/details/121702018
今日推荐