Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes, Strings are immutable, so they only calculate their hashCode once, then cache it. However, you need to explicitly intern them with String.intern() if you want to avoid multiple copies of the same String.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: