Hacker Newsnew | comments | show | ask | jobs | submit login

Actually the == comparison is VERY consistent. == will return true only if the values are identical--in the case of primitives, this means the ints or doubles are identical, and in the case of objects it means the pointers have identical values--meaning they point to the exact same object. But this way I know that if I want to do something like change the way things stored in sets, I have to modify equals(), since that's what maps and sets use to check equality.

Strings are only allowed to use + because strings were traditionally seen as primitive types, rather than the objects they are in Java. It's a small inconsistency, but more of a concession to existing practice.

I'm not sure what else the "on and on" refers to...




Applications are open for YC Winter 2016

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: