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

If OOP encourages mutation can you explain to me why the String class in java is immutable?


It's a holdover from when Java was supposed to be a language for small machines.

However, if you're being snide, let me retort "So why does everybody in Java immediately recommend that you use the StringBuilder class instead of String?"




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

Search: