1

Why Boolean hashCode is either 1231 or 1237? i.e.

public static int hashCode(boolean value) {
        return value ? 1231 : 1237;
    }

any specific reason? We are passing String value "true" or "false" in the Boolean constructor so why not we are using the hashcode of these Strings("true" and "false") itself? or we can use 0 and 1

0 Answers0