Hacker News new | past | comments | ask | show | jobs | submit login

Java cannot express immutability. `final` is not transitive, so nothing stops an unrelated change in code to break something that was immutable earlier. Same with Golang.



You can express immutability simply by making all instance variables private and not providing any methods to modify them.




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

Search: